作者 邓超

ai邮件模糊过滤 postmaster

@@ -50,7 +50,7 @@ class MailList extends Base { @@ -50,7 +50,7 @@ class MailList extends Base {
50 50
51 51
52 private function from_not_in(){ 52 private function from_not_in(){
53 - $where['from.notin'] = []; 53 + $where = [];
54 /** 54 /**
55 * 不查询哪些发件人的邮件 55 * 不查询哪些发件人的邮件
56 */ 56 */
@@ -67,16 +67,17 @@ class MailList extends Base { @@ -67,16 +67,17 @@ class MailList extends Base {
67 return false; 67 return false;
68 }); 68 });
69 if($form_not_in){ 69 if($form_not_in){
70 - if(isset($where['from.notin'])){  
71 - $where['from.notin'] = array_merge($where['from.notin'],$form_not_in);  
72 - }else{  
73 - $where['from.notin'] = $form_not_in;  
74 - }  
75 - 70 + $where = array_merge($where,$form_not_in);
  71 + }
  72 + }
  73 + // 过滤掉
  74 + foreach ($where as $k=>$item){
  75 + if(stripos($item,'postmaster@') === 0){
  76 + unset($where[$k]);
76 } 77 }
77 } 78 }
78 79
79 - return $where['from.notin']; 80 + return $where;
80 } 81 }
81 82
82 /** 83 /**
@@ -147,6 +148,7 @@ class MailList extends Base { @@ -147,6 +148,7 @@ class MailList extends Base {
147 $where['deleted'] = 0; 148 $where['deleted'] = 0;
148 149
149 $where['from.notin'] = $this->from_not_in(); 150 $where['from.notin'] = $this->from_not_in();
  151 + $where['_'] = "`from` not like 'postmaster@%%'";
150 if(!$where['from.notin']) unset($where['from.notin']); 152 if(!$where['from.notin']) unset($where['from.notin']);
151 153
152 $filed = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`lists`.`email_id`,`to_name`'; 154 $filed = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`lists`.`email_id`,`to_name`';
@@ -210,6 +212,7 @@ class MailList extends Base { @@ -210,6 +212,7 @@ class MailList extends Base {
210 $where['lists|deleted'] = 0; //未删状态 212 $where['lists|deleted'] = 0; //未删状态
211 // 屏蔽哪些邮件 213 // 屏蔽哪些邮件
212 $where['from.notin'] = $this->from_not_in(); 214 $where['from.notin'] = $this->from_not_in();
  215 + $where['_'] = "`from` not like 'postmaster@%'";
213 if(!$where['from.notin']) unset($where['from.notin']); 216 if(!$where['from.notin']) unset($where['from.notin']);
214 217
215 // 发件箱 218 // 发件箱