...
|
...
|
@@ -136,6 +136,32 @@ class Messager { |
|
|
$this->item[$msgno]->size = array_shift($tokens);
|
|
|
break;
|
|
|
}
|
|
|
//* 1 FETCH (UID 1568602720 INTERNALDATE "16-Sep-2019 10:58:40 +0800" FLAGS (\Seen) BODYSTRUCTURE (("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 4115 97 NIL NI
|
|
|
//L NIL) "mixed" ("boundary" "----=_Part_340444_1698792253.1568602720140") NIL NIL) RFC822.HEADER {816}
|
|
|
case 'BODYSTRUCTURE':{
|
|
|
$BODYSTRUCTURE = '';
|
|
|
$leftNum = $RightNum = 0;
|
|
|
foreach ($tokens as $key=>$str){
|
|
|
// 还有括号不对等的情况,无语了
|
|
|
if($str == 'RFC822.HEADER'){
|
|
|
break;
|
|
|
}
|
|
|
// 找出现的次数
|
|
|
$leftNum += substr_count($str,'(');
|
|
|
$RightNum += substr_count($str,')');
|
|
|
// 拼接起来
|
|
|
$BODYSTRUCTURE .= ' '.$str;
|
|
|
unset($tokens[$key]);
|
|
|
// 说明找到结束了
|
|
|
if($leftNum===$RightNum){
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
$tokens = array_values($tokens);
|
|
|
|
|
|
$this->item[$msgno]->bodystructure = $BODYSTRUCTURE;
|
|
|
break;
|
|
|
}
|
|
|
case 'RFC822.HEADER':{
|
|
|
$str = trim(implode(' ',$tokens));
|
|
|
// 是否带有字符数数量
|
...
|
...
|
|