| 
@@ -25,16 +25,13 @@ class SyncMail { | 
 | 
@@ -25,16 +25,13 @@ class SyncMail { | 
| 
25
 | 
 
 | 
25
 | 
 
 | 
| 
26
 | 
     public function __construct(int $id, array $data)
 | 
26
 | 
     public function __construct(int $id, array $data)
 | 
| 
27
 | 
     {
 | 
27
 | 
     {
 | 
| 
28
 | 
-//        if(php_sapi_name() == 'cli'){
 | 
28
 | 
+
 | 
| 
29
 | 
             $this->db = db();
 | 
29
 | 
             $this->db = db();
 | 
| 
30
 | 
 
 | 
30
 | 
 
 | 
| 
31
 | 
             if($data['is_hots']){
 | 
31
 | 
             if($data['is_hots']){
 | 
| 
32
 | 
                 return true;
 | 
32
 | 
                 return true;
 | 
| 
33
 | 
             }
 | 
33
 | 
             }
 | 
| 
34
 | 
-            // 是否是预热邮件 aicc专用
 | 
 | 
   | 
| 
35
 | 
-//            if(!empty($header['Aicc-Hot-Mail']) || !empty($header['aicc-hot-mail'])){
 | 
 | 
   | 
| 
36
 | 
-//                return $this->hot($id);
 | 
 | 
   | 
| 
37
 | 
-//            }
 | 
34
 | 
+
 | 
| 
38
 | 
 
 | 
35
 | 
 
 | 
| 
39
 | 
             // 是否在指定文件夹内
 | 
36
 | 
             // 是否在指定文件夹内
 | 
| 
40
 | 
             $f = $this->db->value(folderSql::first($data['folder_id'],'folder'));
 | 
37
 | 
             $f = $this->db->value(folderSql::first($data['folder_id'],'folder'));
 | 
 | 
@@ -42,21 +39,6 @@ class SyncMail { | 
 | 
@@ -42,21 +39,6 @@ class SyncMail { | 
| 
42
 | 
                 return true;
 | 
39
 | 
                 return true;
 | 
| 
43
 | 
             }
 | 
40
 | 
             }
 | 
| 
44
 | 
             $f = folderAlias($f);
 | 
41
 | 
             $f = folderAlias($f);
 | 
| 
45
 | 
-//            if($f=='发件箱'){
 | 
 | 
   | 
| 
46
 | 
-//                if(empty($data['to_name'])){
 | 
 | 
   | 
| 
47
 | 
-//                    $data['to_name'] = [];
 | 
 | 
   | 
| 
48
 | 
-//                }
 | 
 | 
   | 
| 
49
 | 
-//
 | 
 | 
   | 
| 
50
 | 
-//                $data['to_name'] = is_array($data['to_name'])?$data['to_name']:json_decode($data['to_name']);
 | 
 | 
   | 
| 
51
 | 
-//
 | 
 | 
   | 
| 
52
 | 
-//                $w = ['email' => array_map('strtolower',array_column($data['to_name'],'email'))];
 | 
 | 
   | 
| 
53
 | 
-//            }else{
 | 
 | 
   | 
| 
54
 | 
-//                $w = ['email' => strtolower($data['from'])];
 | 
 | 
   | 
| 
55
 | 
-//            }
 | 
 | 
   | 
| 
56
 | 
-//            // 是否在 预热邮箱中
 | 
 | 
   | 
| 
57
 | 
-//            if($w['email'] && $this->db->count('select count(*) from `hot_mail` where '.dbWhere($w))){
 | 
 | 
   | 
| 
58
 | 
-//                return $this->hot($id);
 | 
 | 
   | 
| 
59
 | 
-//            }
 | 
 | 
   | 
| 
60
 | 
 
 | 
42
 | 
 
 | 
| 
61
 | 
 
 | 
43
 | 
 
 | 
| 
62
 | 
             // 不是预热邮箱
 | 
44
 | 
             // 不是预热邮箱
 | 
 | 
@@ -64,7 +46,6 @@ class SyncMail { | 
 | 
@@ -64,7 +46,6 @@ class SyncMail { | 
| 
64
 | 
 
 | 
46
 | 
 
 | 
| 
65
 | 
                 $this->auto_mail($id,$data);
 | 
47
 | 
                 $this->auto_mail($id,$data);
 | 
| 
66
 | 
 
 | 
48
 | 
 
 | 
| 
67
 | 
-                $this->black_mail($id,$data);
 | 
 | 
   | 
| 
68
 | 
 
 | 
49
 | 
 
 | 
| 
69
 | 
                 // 邮件过滤 这些邮箱都是系统邮箱
 | 
50
 | 
                 // 邮件过滤 这些邮箱都是系统邮箱
 | 
| 
70
 | 
 //            if(!$this->checkEmail($data['from']) && !$this->checkSubject($data['subject'])){
 | 
51
 | 
 //            if(!$this->checkEmail($data['from']) && !$this->checkSubject($data['subject'])){
 | 
 | 
@@ -89,15 +70,9 @@ class SyncMail { | 
 | 
@@ -89,15 +70,9 @@ class SyncMail { | 
| 
89
 | 
 
 | 
70
 | 
 
 | 
| 
90
 | 
             }
 | 
71
 | 
             }
 | 
| 
91
 | 
 
 | 
72
 | 
 
 | 
| 
92
 | 
-//        }
 | 
 | 
   | 
| 
93
 | 
-
 | 
 | 
   | 
| 
94
 | 
-
 | 
 | 
   | 
| 
95
 | 
 
 | 
73
 | 
 
 | 
| 
96
 | 
     }
 | 
74
 | 
     }
 | 
| 
97
 | 
 
 | 
75
 | 
 
 | 
| 
98
 | 
-//    private function hot($id){
 | 
 | 
   | 
| 
99
 | 
-//        return $this->db->update(listsSql::$table,['is_hots'=>1],dbWhere(['id'=>$id]));
 | 
 | 
   | 
| 
100
 | 
-//    }
 | 
 | 
   | 
| 
101
 | 
 
 | 
76
 | 
 
 | 
| 
102
 | 
 
 | 
77
 | 
 
 | 
| 
103
 | 
     /**
 | 
78
 | 
     /**
 | 
 | 
@@ -173,31 +148,6 @@ class SyncMail { | 
 | 
@@ -173,31 +148,6 @@ class SyncMail { | 
| 
173
 | 
 
 | 
148
 | 
 
 | 
| 
174
 | 
     }
 | 
149
 | 
     }
 | 
| 
175
 | 
 
 | 
150
 | 
 
 | 
| 
176
 | 
-    /**
 | 
 | 
   | 
| 
177
 | 
-     * 黑名单邮箱,直接delete
 | 
 | 
   | 
| 
178
 | 
-     * @param $id
 | 
 | 
   | 
| 
179
 | 
-     * @param $data
 | 
 | 
   | 
| 
180
 | 
-     * @author:dc
 | 
 | 
   | 
| 
181
 | 
-     * @time 2024/9/12 15:29
 | 
 | 
   | 
| 
182
 | 
-     */
 | 
 | 
   | 
| 
183
 | 
-    private function black_mail($id,$data){
 | 
 | 
   | 
| 
184
 | 
-
 | 
 | 
   | 
| 
185
 | 
-        if(!empty($data['from'])){
 | 
 | 
   | 
| 
186
 | 
-            // 是否是ai邮件
 | 
 | 
   | 
| 
187
 | 
-            if($this->db->count("select count(*) from `hot_mail` where ".dbWhere([
 | 
 | 
   | 
| 
188
 | 
-                    'email'=> $this->db->value(emailSql::first($data['email_id'],'`email`'))
 | 
 | 
   | 
| 
189
 | 
-                ]))){
 | 
 | 
   | 
| 
190
 | 
-                // 是否在黑名单中
 | 
 | 
   | 
| 
191
 | 
-                if($this->db->count("select count(*) from `ai_black_email` where ".dbWhere(['email'=>$data['from']]))){
 | 
 | 
   | 
| 
192
 | 
-
 | 
 | 
   | 
| 
193
 | 
-                    $this->db->update(listsSql::$table,['deleted'=>1],dbWhere(['id'=>$id]));
 | 
 | 
   | 
| 
194
 | 
-                }
 | 
 | 
   | 
| 
195
 | 
-
 | 
 | 
   | 
| 
196
 | 
-            }
 | 
 | 
   | 
| 
197
 | 
-
 | 
 | 
   | 
| 
198
 | 
-        }
 | 
 | 
   | 
| 
199
 | 
-
 | 
 | 
   | 
| 
200
 | 
-    }
 | 
 | 
   | 
| 
201
 | 
 
 | 
151
 | 
 
 | 
| 
202
 | 
 
 | 
152
 | 
 
 | 
| 
203
 | 
 } | 
153
 | 
 } |