...
|
...
|
@@ -415,13 +415,21 @@ class SyncMail { |
|
|
$this->db->update(listsSql::$table,$data,dbWhere(['id'=> $id]));
|
|
|
}
|
|
|
|
|
|
//TODO 如果header 头信息里面有2段数据 第二段就作为内容解析
|
|
|
if($item->header->body()){
|
|
|
$parseBody = $item->header->body();
|
|
|
}elseif($isBody && $item->body->getRaw()){
|
|
|
$parseBody = $item->body->getRaw();
|
|
|
}else{
|
|
|
$parseBody = false;
|
|
|
}
|
|
|
|
|
|
// 是否同步body内容
|
|
|
if($isBody && $item->body->getRaw()){
|
|
|
if($parseBody){
|
|
|
// 记录邮件体 源文件
|
|
|
Log::put(
|
|
|
ROOT_PATH.'/eml/'.$this->email['email']."/".$item->getFolderName().'/'.$item->uid.'.eml',
|
|
|
$item->header->getRaw()."\r\n\r\n".$item->body->getRaw()
|
|
|
$item->header->getRaw()."\r\n\r\n".$parseBody->getRaw()
|
|
|
);
|
|
|
|
|
|
$body = [
|
...
|
...
|
@@ -431,14 +439,14 @@ class SyncMail { |
|
|
|
|
|
|
|
|
$body['text_html'][] = [
|
|
|
'body' => base64_encode($item->getBody()->getHtml() ? : $item->getBody()->getText()),
|
|
|
'type' => $item->getBody()->getHtml()?'text/html':'text/plain',
|
|
|
'body' => base64_encode($parseBody->getHtml() ? : $parseBody->getText()),
|
|
|
'type' => $parseBody->getHtml()?'text/html':'text/plain',
|
|
|
'charset' => 'utf-8',
|
|
|
'encode' => 'base64',
|
|
|
];
|
|
|
|
|
|
// 处理附件
|
|
|
foreach ($item->getBody()->getAttachment() as $itemBody){
|
|
|
foreach ($parseBody->getAttachment() as $itemBody){
|
|
|
$tmp = [
|
|
|
'body' => '',
|
|
|
'type' => $itemBody->getFileType(),
|
...
|
...
|
@@ -473,7 +481,7 @@ class SyncMail { |
|
|
// 更新描述
|
|
|
$this->db->update(listsSql::$table,[
|
|
|
'description'=>
|
|
|
Fun::mb_convert_encoding(mb_substr($item->getBody()->getText(),0,150),'utf-8')
|
|
|
Fun::mb_convert_encoding(mb_substr($parseBody->getText(),0,150),'utf-8')
|
|
|
],dbWhere(['id'=> $id]));
|
|
|
|
|
|
}
|
...
|
...
|
|