Use SASL-IR for #1245

This commit is contained in:
the-djmaze 2023-12-03 17:57:27 +01:00
parent 56a5f29f26
commit 2400c6def8

View file

@ -158,7 +158,13 @@ class ImapClient extends \MailSo\Net\NetClient
{
if (\str_starts_with($type, 'SCRAM-'))
{
$this->sendRaw($this->SendRequestGetResponse('AUTHENTICATE', array($type, $SASL->authenticate($sLogin, $sPassword))));
$sAuth = $SASL->authenticate($sLogin, $sPassword);
if ($this->hasCapability('SASL-IR')) {
$this->sendRaw($this->SendRequestGetResponse('AUTHENTICATE', array($type, $sAuth)));
} else {
$this->SendRequestGetResponse('AUTHENTICATE', array($type));
$this->sendRaw($sAuth);
}
$sChallenge = $SASL->challenge($this->getResponseValue($this->getResponse(), Enumerations\ResponseType::CONTINUATION));
$this->logMask($sChallenge);
$this->sendRaw($sChallenge);