作者 邓超

兼容 微软邮箱

... ... @@ -885,8 +885,16 @@ class Imap {
// RFC822.TEXT不能和 BODY[HEADER.FIELDS 同时存在,否则解析失败
case 'RFC822.TEXT':{
array_shift($header);
$result['RFC822.TEXT'] = implode(' ',$header);
$result['RFC822.TEXT'] = trim(implode(' ',$header));
$header = [];
// 微软的邮箱有毛病
$endLine = explode("\n",$result['RFC822.TEXT']);
$endLine = trim(end($endLine));
if(preg_match("/^UID\s\d+\sFLAGS\s\(.*\)$/iU",$endLine)){
$arr = $this->parseFetch($endLine);
$result = array_merge($result,$arr);
$result['RFC822.TEXT'] = mb_substr($result['RFC822.TEXT'],0,-mb_strlen($endLine));
}
break;
}
case 'RFC822.HEADER':{
... ...