正在显示
1 个修改的文件
包含
27 行增加
和
22 行删除
@@ -321,29 +321,34 @@ class SyncMail { | @@ -321,29 +321,34 @@ class SyncMail { | ||
321 | */ | 321 | */ |
322 | protected function saveMail(int $folder_id, array $lists, bool $isBody=false){ | 322 | protected function saveMail(int $folder_id, array $lists, bool $isBody=false){ |
323 | foreach ($lists as $item){ | 323 | foreach ($lists as $item){ |
324 | - | ||
325 | - $data = [ | ||
326 | - 'uid' => $item->uid, | ||
327 | - 'subject' => mb_substr($item->header->getSubject(),0,1000),// 控制下,有的蛋疼,整tm多长 | ||
328 | - 'cc' => $item->header->getCc(true), | ||
329 | - 'bcc' => $item->header->getBcc(true), | ||
330 | - 'from' => $item->header->getFrom()->email, | ||
331 | - 'from_name' => $item->header->getFrom()->name, | ||
332 | - 'to' => implode(',',array_column($item->header->getTo(true),'email')), | ||
333 | - 'to_name' => $item->header->getTo(true), | ||
334 | - // 这个是 邮件的时间 就是header里面带的 一般情况就是发件时间 | 324 | + try { |
325 | + $data = [ | ||
326 | + 'uid' => $item->uid, | ||
327 | + 'subject' => mb_substr($item->header->getSubject(),0,1000),// 控制下,有的蛋疼,整tm多长 | ||
328 | + 'cc' => $item->header->getCc(true), | ||
329 | + 'bcc' => $item->header->getBcc(true), | ||
330 | + 'from' => $item->header->getFrom()->email, | ||
331 | + 'from_name' => $item->header->getFrom()->name, | ||
332 | + 'to' => implode(',',array_column($item->header->getTo(true),'email')), | ||
333 | + 'to_name' => $item->header->getTo(true), | ||
334 | + // 这个是 邮件的时间 就是header里面带的 一般情况就是发件时间 | ||
335 | // 'date' => strtotime($item->header->getDate()), | 335 | // 'date' => strtotime($item->header->getDate()), |
336 | - 'udate' => strtotime($item->date), // 有这个时间就够了,内部时间,就是收到邮件的时间 | ||
337 | - 'size' => $item->size, | ||
338 | - 'recent' => $item->isRecent() ? 1 : 0, | ||
339 | - 'seen' => $item->isSeen() ? 1 : 0, | ||
340 | - 'draft' => $item->isDraft() ? 1 : 0, | ||
341 | - 'flagged' => $item->isFlagged() ? 1 : 0, | ||
342 | - 'answered' => $item->isAnswered() ? 1 : 0, | ||
343 | - 'folder_id' => $folder_id, | ||
344 | - 'email_id' => $this->emailId(), | ||
345 | - 'is_file' => $item->isAttachment() ? 1: 0 //是否附件 | ||
346 | - ]; | 336 | + 'udate' => strtotime($item->date), // 有这个时间就够了,内部时间,就是收到邮件的时间 |
337 | + 'size' => $item->size, | ||
338 | + 'recent' => $item->isRecent() ? 1 : 0, | ||
339 | + 'seen' => $item->isSeen() ? 1 : 0, | ||
340 | + 'draft' => $item->isDraft() ? 1 : 0, | ||
341 | + 'flagged' => $item->isFlagged() ? 1 : 0, | ||
342 | + 'answered' => $item->isAnswered() ? 1 : 0, | ||
343 | + 'folder_id' => $folder_id, | ||
344 | + 'email_id' => $this->emailId(), | ||
345 | + 'is_file' => $item->isAttachment() ? 1: 0 //是否附件 | ||
346 | + ]; | ||
347 | + }catch (\Throwable $e){ | ||
348 | + logs([$e->getMessage(),$folder_id,$this->emailId(),$item->uid]); | ||
349 | + continue; | ||
350 | + } | ||
351 | + | ||
347 | 352 | ||
348 | $data['from'] = mb_substr($data['from'],0,120); | 353 | $data['from'] = mb_substr($data['from'],0,120); |
349 | 354 |
-
请 注册 或 登录 后发表评论