| 
...
 | 
...
 | 
@@ -25,16 +25,13 @@ class SyncMail { | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     public function __construct(int $id, array $data)
 | 
| 
 | 
 | 
     {
 | 
| 
 | 
 | 
 //        if(php_sapi_name() == 'cli'){
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             $this->db = db();
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             if($data['is_hots']){
 | 
| 
 | 
 | 
                 return true;
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
             // 是否是预热邮件 aicc专用
 | 
| 
 | 
 | 
 //            if(!empty($header['Aicc-Hot-Mail']) || !empty($header['aicc-hot-mail'])){
 | 
| 
 | 
 | 
 //                return $this->hot($id);
 | 
| 
 | 
 | 
 //            }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             // 是否在指定文件夹内
 | 
| 
 | 
 | 
             $f = $this->db->value(folderSql::first($data['folder_id'],'folder'));
 | 
| 
...
 | 
...
 | 
@@ -42,21 +39,6 @@ class SyncMail { | 
| 
 | 
 | 
                 return true;
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
             $f = folderAlias($f);
 | 
| 
 | 
 | 
 //            if($f=='发件箱'){
 | 
| 
 | 
 | 
 //                if(empty($data['to_name'])){
 | 
| 
 | 
 | 
 //                    $data['to_name'] = [];
 | 
| 
 | 
 | 
 //                }
 | 
| 
 | 
 | 
 //
 | 
| 
 | 
 | 
 //                $data['to_name'] = is_array($data['to_name'])?$data['to_name']:json_decode($data['to_name']);
 | 
| 
 | 
 | 
 //
 | 
| 
 | 
 | 
 //                $w = ['email' => array_map('strtolower',array_column($data['to_name'],'email'))];
 | 
| 
 | 
 | 
 //            }else{
 | 
| 
 | 
 | 
 //                $w = ['email' => strtolower($data['from'])];
 | 
| 
 | 
 | 
 //            }
 | 
| 
 | 
 | 
 //            // 是否在 预热邮箱中
 | 
| 
 | 
 | 
 //            if($w['email'] && $this->db->count('select count(*) from `hot_mail` where '.dbWhere($w))){
 | 
| 
 | 
 | 
 //                return $this->hot($id);
 | 
| 
 | 
 | 
 //            }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             // 不是预热邮箱
 | 
| 
...
 | 
...
 | 
@@ -64,7 +46,6 @@ class SyncMail { | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                 $this->auto_mail($id,$data);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                 $this->black_mail($id,$data);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                 // 邮件过滤 这些邮箱都是系统邮箱
 | 
| 
 | 
 | 
 //            if(!$this->checkEmail($data['from']) && !$this->checkSubject($data['subject'])){
 | 
| 
...
 | 
...
 | 
@@ -89,15 +70,9 @@ class SyncMail { | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //        }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //    private function hot($id){
 | 
| 
 | 
 | 
 //        return $this->db->update(listsSql::$table,['is_hots'=>1],dbWhere(['id'=>$id]));
 | 
| 
 | 
 | 
 //    }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
...
 | 
...
 | 
@@ -173,31 +148,6 @@ class SyncMail { | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     /**
 | 
| 
 | 
 | 
      * 黑名单邮箱,直接delete
 | 
| 
 | 
 | 
      * @param $id
 | 
| 
 | 
 | 
      * @param $data
 | 
| 
 | 
 | 
      * @author:dc
 | 
| 
 | 
 | 
      * @time 2024/9/12 15:29
 | 
| 
 | 
 | 
      */
 | 
| 
 | 
 | 
     private function black_mail($id,$data){
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         if(!empty($data['from'])){
 | 
| 
 | 
 | 
             // 是否是ai邮件
 | 
| 
 | 
 | 
             if($this->db->count("select count(*) from `hot_mail` where ".dbWhere([
 | 
| 
 | 
 | 
                     'email'=> $this->db->value(emailSql::first($data['email_id'],'`email`'))
 | 
| 
 | 
 | 
                 ]))){
 | 
| 
 | 
 | 
                 // 是否在黑名单中
 | 
| 
 | 
 | 
                 if($this->db->count("select count(*) from `ai_black_email` where ".dbWhere(['email'=>$data['from']]))){
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                     $this->db->update(listsSql::$table,['deleted'=>1],dbWhere(['id'=>$id]));
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 } | 
 | 
 | 
\ No newline at end of file | 
...
 | 
...
 | 
 |