作者 邓超

xxx

... ... @@ -459,7 +459,18 @@ class Home extends Base {
*/
public function move(){
$this->moveCopy(function (Mail $mailInstance,$uid,$origin_folder,$to_origin_folder){
return $mailInstance->move($uid,$origin_folder,$to_origin_folder);
try {
return $mailInstance->move($uid,$origin_folder,$to_origin_folder);
}catch (\Throwable $e){
if(app()->request('move_err_copy')){
// 复制成功
if($mailInstance->copy($uid,$origin_folder,$to_origin_folder)){
return $mailInstance->deleted($uid,$origin_folder);
}
}
}
return false;
});
}
... ...
... ... @@ -516,6 +516,23 @@ class Mail {
}
/**
* 删除标记
* @param $uids
* @param $folder
* @param $del
* @return bool
* @throws \Exception
* @author:dc
* @time 2024/3/9 16:50
*/
public function deleted($uids,$folder,$del=true):bool{
// 选择目录
$status = $this->client->selectFolder($folder);
return $this->client->flags($uids,[Imap::FLAGS_DELETED],$del ? '+' : '-',true);
}
/**
* 回复标记
* @param $uids
* @param $folder
... ...