...
|
...
|
@@ -198,6 +198,13 @@ class Mail { |
|
|
return true;
|
|
|
}
|
|
|
|
|
|
// 读取黑名单
|
|
|
$blacklist = redis()->get('blacklist:'.$email_id);
|
|
|
$blackFolder = '';
|
|
|
if($blacklist){
|
|
|
$blackFolder = $db->value(folderSql::originFolder($email_id,'垃圾箱'));
|
|
|
}
|
|
|
|
|
|
//
|
|
|
$nu = 100;
|
|
|
$msgno = 1;
|
...
|
...
|
@@ -289,6 +296,27 @@ class Mail { |
|
|
'is_file' => MailFun::isFile($result['BODYSTRUCTURE']??'') ? 1: 0 //是否附件
|
|
|
];
|
|
|
$data['date'] = $data['date'] ? : 0;
|
|
|
|
|
|
// 验证是否存在黑名单中
|
|
|
if($blacklist){
|
|
|
// 邮箱是否在黑名单中
|
|
|
$isBlacklist = false;
|
|
|
if (!empty($blacklist['emails']) && is_array($blacklist['emails']) && in_array($data['from'],$blacklist['emails'])){
|
|
|
$isBlacklist = true;
|
|
|
}
|
|
|
// 域是否存在
|
|
|
if (!empty($blacklist['domain']) && is_array($blacklist['domain']) && in_array(explode('@',$data['from'])[1],$blacklist['domain'])){
|
|
|
$isBlacklist = true;
|
|
|
}
|
|
|
|
|
|
if($isBlacklist && $blackFolder){
|
|
|
// 移入垃圾箱
|
|
|
$this->client->move($result['UID'],$blackFolder);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}catch (\Throwable $e){
|
|
|
logs(
|
|
|
'邮件解析失败:'.PHP_EOL.$e->getMessage().PHP_EOL.print_r($result,true),
|
...
|
...
|
|