Detect IMAP LOGINDISABLED capability

Enable IMAP SASL-IR capability
This commit is contained in:
djmaze 2021-03-31 23:01:03 +02:00
parent f17609b442
commit bb836fdb59

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))) if (!strlen(\trim($sLogin)) || !strlen(\trim($sPassword)) || $this->IsSupported('LOGINDISABLED'))
{ {
$this->writeLogException( $this->writeLogException(
new \MailSo\Base\Exceptions\InvalidArgumentException, new \MailSo\Base\Exceptions\InvalidArgumentException,
@ -190,8 +190,7 @@ class ImapClient extends \MailSo\Net\NetClient
{ {
$sToken = $SASL->authenticate($sLogin, $sPassword, $sTicket); $sToken = $SASL->authenticate($sLogin, $sPassword, $sTicket);
$sTicket = \base64_decode($sTicket); $this->oLogger->Write('ticket: '.\base64_decode($sTicket));
$this->oLogger->Write('ticket: '.$sTicket);
if ($this->oLogger) if ($this->oLogger)
{ {
@ -223,7 +222,7 @@ class ImapClient extends \MailSo\Net\NetClient
$this->oLogger->AddSecret($sToken); $this->oLogger->AddSecret($sToken);
} }
if ($this->IsSupported('AUTH=SASL-IR') && false) if ($this->IsSupported('SASL-IR'))
{ {
$this->SendRequestGetResponse('AUTHENTICATE', array('PLAIN', $sToken)); $this->SendRequestGetResponse('AUTHENTICATE', array('PLAIN', $sToken));
} }