作者 邓超

mail del

... ... @@ -105,20 +105,19 @@ function sync($email_id){
$ids = $db->all("select `id`,`uid` from ".\Model\listsSql::$table." where `email_id` = {$email_id} and `folder_id` = {$folder_id} limit 100 offset ".($page*100));
$page++;
if($ids){
try {
$result = $mailServer->client->fetch(array_column($ids,'uid'),'UID',true);
$result = array_column($result,'UID');
}catch (Throwable $e){
return 0;
}
foreach ($ids as $id){
$uid = $id['uid'];
$id = $id['id'];
if(!in_array($uid,$result)){
try {
$result = $mailServer->client->fetch($uid,'UID',true);
}catch (Throwable $e){
continue;
}
if(!$result){
_echo('删除 e '.$email_id.' f '.$folder_id.' u '.$uid.' id '.$id.' d '.$db->delete(\Model\listsSql::$table,['id'=>$id]).' fd '.$db->delete('fob_hot_mail',['lists_id'=>$id]).' body '.$db->delete(\Model\bodySql::$table,['lists_id'=>$id]));
// 删除 如果远程没有,就删除本地
}
}
}
// 结束了
... ...