正在显示
1 个修改的文件
包含
28 行增加
和
3 行删除
@@ -51,10 +51,9 @@ class syncMail { | @@ -51,10 +51,9 @@ class syncMail { | ||
51 | 51 | ||
52 | // 不是预热邮箱 | 52 | // 不是预热邮箱 |
53 | if($f=='收件箱'){ | 53 | if($f=='收件箱'){ |
54 | - // mimecast@wsa.aero | ||
55 | - $filterEmail = ['mimecast@wsa.aero']; | 54 | + |
56 | // 邮件过滤 这些邮箱都是系统邮箱 | 55 | // 邮件过滤 这些邮箱都是系统邮箱 |
57 | - if(!in_array($data['from'],$filterEmail) && !preg_match("/^((no-?reply)|(postmaster)|(mailer-daemon)|(email-notifications)|(googleplay-noreply)|(postmaster-noreply)|(privacy-noreply))@/i",$data['from']) && !$this->checkSubject($data['subject'])){ | 56 | + if(!$this->checkEmail($data['from']) && !$this->checkSubject($data['subject'])){ |
58 | // 通知黑格 2024-08-22 新上 这个是异步的不会阻塞当前进程 | 57 | // 通知黑格 2024-08-22 新上 这个是异步的不会阻塞当前进程 |
59 | try { | 58 | try { |
60 | SaberGM::post('https://fob.ai.cc/api/email_new_push',[ | 59 | SaberGM::post('https://fob.ai.cc/api/email_new_push',[ |
@@ -81,6 +80,31 @@ class syncMail { | @@ -81,6 +80,31 @@ class syncMail { | ||
81 | } | 80 | } |
82 | 81 | ||
83 | /** | 82 | /** |
83 | + * 验证邮箱 | ||
84 | + * @param $email | ||
85 | + * @author:dc | ||
86 | + * @time 2024/8/28 14:33 | ||
87 | + */ | ||
88 | + public function checkEmail($email){ | ||
89 | + // mimecast@wsa.aero | ||
90 | + $filterEmail = ['mimecast@wsa.aero']; | ||
91 | + if(in_array($email,$filterEmail)){ | ||
92 | + return true; | ||
93 | + } | ||
94 | + | ||
95 | + if(preg_match("/^((no-?reply)|(postmaster)|(mailer-daemon)|(email-notifications)|(googleplay-noreply)|(postmaster-noreply)|(privacy-noreply))@/i",$email)){ | ||
96 | + return true; | ||
97 | + } | ||
98 | + | ||
99 | + if(preg_match("/((no-?reply)|(postmaster)|(mailer-daemon)|(email-notifications))/i",$email)){ | ||
100 | + return true; | ||
101 | + } | ||
102 | + | ||
103 | + | ||
104 | + return false; | ||
105 | + } | ||
106 | + | ||
107 | + /** | ||
84 | * 验证标题是否存在某些关键词 | 108 | * 验证标题是否存在某些关键词 |
85 | * @param string $subject | 109 | * @param string $subject |
86 | * @return bool | 110 | * @return bool |
@@ -97,6 +121,7 @@ class syncMail { | @@ -97,6 +121,7 @@ class syncMail { | ||
97 | 'Undelivered Mail Returned', | 121 | 'Undelivered Mail Returned', |
98 | 'Mail delivery failed:', | 122 | 'Mail delivery failed:', |
99 | 'Delivery Status Notification', | 123 | 'Delivery Status Notification', |
124 | + 'Undeliverable:', | ||
100 | ]; | 125 | ]; |
101 | 126 | ||
102 | foreach ($keys as $key){ | 127 | foreach ($keys as $key){ |
-
请 注册 或 登录 后发表评论