作者 邓超

qq邮箱有tm毛病

... ... @@ -73,7 +73,7 @@ class Body {
//有一些服务商会把header头一起返回,header里面包含了这个符号,
//如果不加\r\n 就会导致 切割异常
$items = explode("\r\n".$boundary,
str_replace(['--'.$boundary.'--', $boundary.'--','--'.$boundary],"\r\n".$boundary,"\r\n".$body)
str_replace(['--'.$boundary.'--', $boundary.'--','--'.$boundary],$boundary,"\r\n".$body)
);
// qq的有邮箱有毛病,标记是乱的
if(count($items)==1 && preg_match("/^\*\s\d+\sFETCH\s\(/",$body)){
... ... @@ -168,8 +168,7 @@ class Body {
* @time 2024/9/21 9:51
*/
protected function parseItem(string $body) {
$body = str_replace("\n\n","\r\n\r\n",trim($body));
list($mime_header,$text) = explode("\r\n\r\n",($body)."\r\n\r\n",2);
list($mime_header,$text) = explode("\r\n\r\n",trim($body)."\r\n\r\n",2);
$text = trim($text);
// 解析头部
$data = $this->parseMimeHeader($mime_header);
... ...
... ... @@ -36,12 +36,12 @@ class Header{
*/
public function __construct(string $raw_header)
{
$raw_header = str_replace("\r\n\n","\r\n\r\n",trim($raw_header));
$raw_header = str_replace("\r\n","\n",$raw_header);
$raw_header = str_replace("\n","\r\n",$raw_header);
$raw_header = explode("\r\n\r\n",trim($raw_header),2);
$this->raw_header = $raw_header[0];
$this->raw_header = str_replace("\r\n","\n",$this->raw_header);
$this->raw_header = str_replace("\n","\r\n",$this->raw_header);
// qq的会把退信 内容以header形式返回
$this->raw_body = $raw_header[1]??'';
... ...