作者 邓超

x

... ... @@ -39,42 +39,18 @@ class AutoMail {
$this->fids = $this->db->all("select `id` from `folders` where `folder` = '收件箱'");
$this->fids = array_column($this->fids,'id');
$filter = '2 Automatic reply
2 Delivery
2 Automatische Antwort
2 Undeliverable
2 Failure
2 Undelivered
1 noreply
1 postmaster
1 email-notifications
1 mailer-daemon
1 no-reply
2 自动回复
2 Returned mail
2 Autosvar
2 Out Of Office Re
2 Change_of_email_address
2 delivered
2 automatique
2 Reply auto
2 automatic
2 Request received
2 Automatisch
2 Unzustellbar
2 Notification
2 Invitation
2 Automatyczna
2 自動回覆
2 expired';
$filter = explode("\n",$filter);
foreach ($filter as $f) {
if (!$f) continue;
$filter = @file_get_contents('https://fob.ai.cc/api/mail/ai_inbox_filter/'.md5('aicc.'.date('ymdh')));
$filter = @json_decode($filter,true);
if(!is_array($filter)){
return 0;
}
array_map(function ($v){
$this->filter[] = [
intval(mb_substr($f, 0, 1)),
trim(mb_substr($f, 1, 99)),
$v['type'],
$v['text'],
];
}
},$filter[0]);
if(redis()->add('auto_mail_sync2',1,60)){
echo '正在计算数据';
... ... @@ -86,7 +62,7 @@ class AutoMail {
$ids[] = $i+$id;
}
$id = end($ids);
if($id<($maxId-1000000)){
if($id<($maxId-500000)){
continue;
}
redis()->rPush('auto_check_ids',implode(',',$ids));
... ... @@ -142,32 +118,11 @@ class AutoMail {
}
\Co\run(function (){
include_once "../vendor/autoload.php";
// while(1){
new AutoMail();
});
//swoole_set_process_name('auto-reply-run-man');
//
//$pm = new Swoole\Process\Manager();
//
//$pm->addBatch(3,function (){
//
// swoole_set_process_name('auto-reply-email-run');
//
// include_once "../vendor/autoload.php";
//
//// while(1){
// new AutoMail();
// // 执行完了暂停5分钟在执行
// sleep(40);
//// }
//
//},true);
//
//$pm->start();
include_once "../vendor/autoload.php";
new AutoMail();
... ...