|
@@ -41,12 +41,31 @@ class MailBlack { |
|
@@ -41,12 +41,31 @@ class MailBlack { |
41
|
$this->blackFolder = $this->db->cache(3600)->value(folderSql::originFolder($data['email_id'],'垃圾箱'));
|
41
|
$this->blackFolder = $this->db->cache(3600)->value(folderSql::originFolder($data['email_id'],'垃圾箱'));
|
42
|
}
|
42
|
}
|
43
|
|
43
|
|
|
|
44
|
+ $this->check();
|
44
|
|
45
|
|
|
|
46
|
+ }
|
45
|
|
47
|
|
46
|
|
48
|
|
|
|
49
|
+ protected function check(){
|
47
|
|
50
|
|
|
|
51
|
+ // 验证是否存在黑名单中
|
|
|
52
|
+ if($this->blacklist && $this->blackFolder != $folder){
|
|
|
53
|
+ // 邮箱是否在黑名单中
|
|
|
54
|
+ $isBlacklist = false;
|
|
|
55
|
+ if (!empty($blacklist['emails']) && is_array($blacklist['emails']) && in_array($this->data['from'],$blacklist['emails'])){
|
|
|
56
|
+ $isBlacklist = true;
|
|
|
57
|
+ }
|
|
|
58
|
+ // 域是否存在
|
|
|
59
|
+ if (!empty($blacklist['domain']) && is_array($blacklist['domain']) && in_array(explode('@',$this->data['from'])[1],$blacklist['domain'])){
|
|
|
60
|
+ $isBlacklist = true;
|
|
|
61
|
+ }
|
48
|
|
62
|
|
|
|
63
|
+ if($isBlacklist && $this->blackFolder){
|
|
|
64
|
+ // 移入垃圾箱
|
|
|
65
|
+ $this->client->move([$this->data['uid']],$this->blackFolder);
|
|
|
66
|
+ }
|
49
|
}
|
67
|
}
|
50
|
|
68
|
|
|
|
69
|
+ }
|
51
|
|
70
|
|
52
|
} |
71
|
} |