From 2400c6def83dfc3f25830b93c40db389a201d2b0 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 3 Dec 2023 17:57:27 +0100 Subject: [PATCH] Use SASL-IR for #1245 --- .../v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index f4aa710eb..4db46dfe7 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -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);