作者 邓超

x

<?php
/**
* 检查邮件同步时出现的空数据,很奇怪
* 定时任务,每1小时执行一次
*/
require_once "../vendor/autoload.php";
$id = redis()->get('empty_subject_check',185163874);
while($id){
$list = db()->first(\Model\listsSql::first('`id` > '.$id.' and `subject` = ""','`id`,`email_id`,`folder_id`,`uid`'));
if(!$list){
break;
}
$id = $list['id']??0;
echo $id."\n";
$email = db()->first(\Model\emailSql::first($list['email_id']));
$folder = db()->first(\Model\folderSql::first($list['folder_id']));
if(!$folder){continue;}
$config = (new \Lib\Imap\ImapConfig())
// ->debug()
->setEmail($email['email'])
->setPassword(base64_decode($email['password']))
->setHost($email['imap']);
$imap = \Lib\Imap\ImapPool::get($config);
//$imap->debug();
$login = $imap->login();
if($login->isOk()){
(new \Service\SyncMail($email,$imap))->mail($folder['origin_folder'],[$list['uid']]);
}
}
redis()->get('empty_subject_check',$id);
exit;
... ...
... ... @@ -16,6 +16,9 @@ class Test {
public function home(){
return '<iframe src="https://fob.ai.cc/33a9293e4314ea12ebfed9c60ab39f2d" style="width: 100%; height: 1000px;"></iframe>';
return '<iframe src="http://local.admin.hagro.cn/33a9293e4314ea12ebfed9c60ab39f2d" style="width: 100%; height: 1000px;"></iframe>';
if(app()->request('sign')!='s1'){
http_response_code(404);
app()->e(404,404);
... ... @@ -58,6 +61,7 @@ class Test {
}else{
echo $msg->body->getText();
}
// $msg->header->getRaw()
// echo $msg->body->getAttachment();
// foreach ($msg->body->getAttachment() as $attachment){
// header("Content-Type:".$attachment->getFileType());
... ...