Bugfix: LOGINDISABLED is only for the LOGIN command

This commit is contained in:
djmaze 2021-04-01 08:17:02 +02:00
parent bb836fdb59
commit e96ced3bde

View file

@ -149,7 +149,7 @@ class ImapClient extends \MailSo\Net\NetClient
public function Login(string $sLogin, string $sPassword, string $sProxyAuthUser = '', public function Login(string $sLogin, string $sPassword, string $sProxyAuthUser = '',
bool $bUseAuthPlainIfSupported = true, bool $bUseAuthCramMd5IfSupported = true) : self bool $bUseAuthPlainIfSupported = true, bool $bUseAuthCramMd5IfSupported = true) : self
{ {
if (!strlen(\trim($sLogin)) || !strlen(\trim($sPassword)) || $this->IsSupported('LOGINDISABLED')) if (!strlen(\trim($sLogin)) || !strlen(\trim($sPassword)))
{ {
$this->writeLogException( $this->writeLogException(
new \MailSo\Base\Exceptions\InvalidArgumentException, new \MailSo\Base\Exceptions\InvalidArgumentException,
@ -161,7 +161,7 @@ class ImapClient extends \MailSo\Net\NetClient
$this->sLogginedUser = $sLogin; $this->sLogginedUser = $sLogin;
// $encrypted = !empty(\stream_get_meta_data($this->rConnect)['crypto']); // $encrypted = !empty(\stream_get_meta_data($this->rConnect)['crypto']);
$type = 'LOGIN'; // RFC3501 6.2.3 $type = $this->IsSupported('LOGINDISABLED') ? '' : 'LOGIN'; // RFC3501 6.2.3
$types = [ $types = [
// 'SCRAM-SHA-256' => 1, // !$encrypted // 'SCRAM-SHA-256' => 1, // !$encrypted
// 'SCRAM-SHA-1' => 1, // !$encrypted // 'SCRAM-SHA-1' => 1, // !$encrypted