作者 邓超

xxx

@@ -459,7 +459,18 @@ class Home extends Base { @@ -459,7 +459,18 @@ class Home extends Base {
459 */ 459 */
460 public function move(){ 460 public function move(){
461 $this->moveCopy(function (Mail $mailInstance,$uid,$origin_folder,$to_origin_folder){ 461 $this->moveCopy(function (Mail $mailInstance,$uid,$origin_folder,$to_origin_folder){
462 - return $mailInstance->move($uid,$origin_folder,$to_origin_folder); 462 + try {
  463 + return $mailInstance->move($uid,$origin_folder,$to_origin_folder);
  464 + }catch (\Throwable $e){
  465 + if(app()->request('move_err_copy')){
  466 + // 复制成功
  467 + if($mailInstance->copy($uid,$origin_folder,$to_origin_folder)){
  468 + return $mailInstance->deleted($uid,$origin_folder);
  469 + }
  470 + }
  471 + }
  472 + return false;
  473 +
463 }); 474 });
464 } 475 }
465 476
@@ -516,6 +516,23 @@ class Mail { @@ -516,6 +516,23 @@ class Mail {
516 } 516 }
517 517
518 /** 518 /**
  519 + * 删除标记
  520 + * @param $uids
  521 + * @param $folder
  522 + * @param $del
  523 + * @return bool
  524 + * @throws \Exception
  525 + * @author:dc
  526 + * @time 2024/3/9 16:50
  527 + */
  528 + public function deleted($uids,$folder,$del=true):bool{
  529 + // 选择目录
  530 + $status = $this->client->selectFolder($folder);
  531 +
  532 + return $this->client->flags($uids,[Imap::FLAGS_DELETED],$del ? '+' : '-',true);
  533 + }
  534 +
  535 + /**
519 * 回复标记 536 * 回复标记
520 * @param $uids 537 * @param $uids
521 * @param $folder 538 * @param $folder