正在显示
1 个修改的文件
包含
22 行增加
和
1 行删除
@@ -62,7 +62,7 @@ class syncMail { | @@ -62,7 +62,7 @@ class syncMail { | ||
62 | // mimecast@wsa.aero | 62 | // mimecast@wsa.aero |
63 | $filterEmail = ['mimecast@wsa.aero']; | 63 | $filterEmail = ['mimecast@wsa.aero']; |
64 | // 邮件过滤 这些邮箱都是系统邮箱 | 64 | // 邮件过滤 这些邮箱都是系统邮箱 |
65 | - if(!in_array($data['from'],$filterEmail) && !preg_match("/^((no-?reply)|(postmaster)|(mailer-daemon)|(email-notifications)|(googleplay-noreply)|(postmaster-noreply))@/i",$data['from'])){ | 65 | + if(!in_array($data['from'],$filterEmail) && !preg_match("/^((no-?reply)|(postmaster)|(mailer-daemon)|(email-notifications)|(googleplay-noreply)|(postmaster-noreply))@/i",$data['from']) && !$this->checkSubject($data['subject'])){ |
66 | // 通知黑格 2024-08-22 新上 这个是异步的不会阻塞当前进程 | 66 | // 通知黑格 2024-08-22 新上 这个是异步的不会阻塞当前进程 |
67 | try { | 67 | try { |
68 | SaberGM::post('https://fob.ai.cc/api/email_new_push',[ | 68 | SaberGM::post('https://fob.ai.cc/api/email_new_push',[ |
@@ -89,6 +89,27 @@ class syncMail { | @@ -89,6 +89,27 @@ class syncMail { | ||
89 | 89 | ||
90 | } | 90 | } |
91 | 91 | ||
92 | + /** | ||
93 | + * 验证标题是否存在某些关键词 | ||
94 | + * @param string $subject | ||
95 | + * @return bool | ||
96 | + * @author:dc | ||
97 | + * @time 2024/8/24 15:09 | ||
98 | + */ | ||
99 | + public function checkSubject(string $subject){ | ||
100 | + | ||
101 | + $keys = [ | ||
102 | + 'Automatic reply: ', | ||
103 | + ]; | ||
104 | + | ||
105 | + foreach ($keys as $key){ | ||
106 | + if(stripos($subject,$key)!==false){ | ||
107 | + return true; | ||
108 | + } | ||
109 | + } | ||
110 | + | ||
111 | + return false; | ||
112 | + } | ||
92 | 113 | ||
93 | 114 | ||
94 | } | 115 | } |
-
请 注册 或 登录 后发表评论