作者 邓超

x

... ... @@ -187,7 +187,7 @@ class Imap {
}
$password = str_replace('"','\"',$password);
// 登录
$result = $this->request("LOGIN {$username} \"{$password}\"");
... ...
... ... @@ -68,6 +68,16 @@ class Mail {
$this->client->login($host['host'].':'.$host['port'],$this->username,$this->password);
}catch (\Throwable $e){
if($pass_err && $e->getCode() == 403){
// 是否是密码错误
foreach (['NO [ALERT] Invalid credentials (Failure)'] as $em){
if(strpos($e->getMessage(),$em)!==false){
db()->update(
\Model\emailSql::$table,
['pwd_error'=>1],
dbWhere(['email'=>$this->username])
);
}
}
// 一天中超过 3次失败说明密码错误了
// if(redis()->incr('email_login_error:'.md5($this->username),86400) > 10){
// 登录失败了 ,
... ...