正在显示
1 个修改的文件
包含
16 行增加
和
1 行删除
| @@ -103,7 +103,17 @@ class Body { | @@ -103,7 +103,17 @@ class Body { | ||
| 103 | /***************** start 第一行处理 **************/ | 103 | /***************** start 第一行处理 **************/ |
| 104 | // 第一行 UID 1568602721 RFC822.TEXT {589} | 104 | // 第一行 UID 1568602721 RFC822.TEXT {589} |
| 105 | $first = explode(' ',$body[0]); | 105 | $first = explode(' ',$body[0]); |
| 106 | - while (1){ if(str_starts_with(array_shift($first), 'RFC822.')) break; } | 106 | + $rfc822 = true; |
| 107 | + while (1){ | ||
| 108 | + $tempstr = array_shift($first); | ||
| 109 | + if(str_starts_with($tempstr, 'RFC822')) { | ||
| 110 | + // 是否是text 还是全部的包含header | ||
| 111 | + if(str_contains($tempstr, '.')){ | ||
| 112 | + $rfc822 = false; | ||
| 113 | + } | ||
| 114 | + break; | ||
| 115 | + } | ||
| 116 | + } | ||
| 107 | $first = array_values($first); | 117 | $first = array_values($first); |
| 108 | $first[0] = preg_replace("/^\{\d+\}/",'',$first[0]); | 118 | $first[0] = preg_replace("/^\{\d+\}/",'',$first[0]); |
| 109 | // 第一行的结果就是 踢出 UID 1568602721 RFC822.TEXT {589} | 119 | // 第一行的结果就是 踢出 UID 1568602721 RFC822.TEXT {589} |
| @@ -119,6 +129,11 @@ class Body { | @@ -119,6 +129,11 @@ class Body { | ||
| 119 | 129 | ||
| 120 | // 再次组装成字符串 | 130 | // 再次组装成字符串 |
| 121 | $data->body = trim(implode("\r\n",$body)); | 131 | $data->body = trim(implode("\r\n",$body)); |
| 132 | + // 是否包含header | ||
| 133 | + if($rfc822){ | ||
| 134 | + // 删除header头信息这个是多余的 | ||
| 135 | + $data->body = explode("\r\n\r\n",$data->body,2)[1]; | ||
| 136 | + } | ||
| 122 | 137 | ||
| 123 | $this->items[] = $this->bodyDeCode($data); | 138 | $this->items[] = $this->bodyDeCode($data); |
| 124 | 139 |
-
请 注册 或 登录 后发表评论