|
...
|
...
|
@@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
namespace Controller;
|
|
|
|
|
|
|
|
use Lib\Imap\ImapConfig;
|
|
|
|
use Lib\Imap\ImapPool;
|
|
|
|
use Lib\Mail\Mail;
|
|
|
|
use Lib\Mail\MailFun;
|
|
|
|
use Lib\UploadFile;
|
|
...
|
...
|
@@ -316,19 +318,27 @@ class Home extends Base { |
|
|
|
|
|
|
|
|
|
|
|
$lists = db()->all(emailSql::getValues(['email'=>web_request_emails()],'`id`,`pwd_error`,`email`,`password`,`imap`'));
|
|
|
|
if(count($lists)>1){
|
|
|
|
return array_column($lists,'pwd_error','email');
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($lists as $k=>$list){
|
|
|
|
if(!$list['pwd_error']){
|
|
|
|
$mail = new \Lib\Mail\Mail($list['email'],base64_decode($list['password']),$list['imap']);
|
|
|
|
|
|
|
|
// 2次登录请求
|
|
|
|
if($mail->login()!==1){
|
|
|
|
if($mail->login()!==1){
|
|
|
|
$lists[$k]['pwd_error'] = 1;
|
|
|
|
$list['host'] = $list['imap'];
|
|
|
|
$list['password'] = base64_decode($list['password']);
|
|
|
|
$imap = ImapPool::get(new ImapConfig($list));
|
|
|
|
$n = $imap->login()->isOk();
|
|
|
|
if($n){
|
|
|
|
if($lists[$k]['pwd_error']){
|
|
|
|
db()->update(emailSql::$table,['pwd_error'=>0],'`id` = '.$list['id']);
|
|
|
|
}
|
|
|
|
$lists[$k]['pwd_error'] = 0;
|
|
|
|
}else{
|
|
|
|
if(!$lists[$k]['pwd_error']){
|
|
|
|
db()->update(emailSql::$table,['pwd_error'=>1],'`id` = '.$list['id']);
|
|
|
|
}
|
|
|
|
$lists[$k]['pwd_error'] = 1;
|
|
|
|
}
|
|
|
|
$mail = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
...
|
...
|
|