From b5356a4115a896879d2478527e66d6dc49a8971a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 21 Mar 2023 19:08:17 +0100 Subject: [PATCH] Improve #1038 --- .../v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php index cffaeb056..679e07287 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php @@ -133,9 +133,10 @@ class SmtpClient extends \MailSo\Net\NetClient $this->writeLogException(new \MailSo\Smtp\Exceptions\LoginBadMethodException); } - if ($this->Settings->authPlainLine) { + $SASL = \SnappyMail\SASL::factory($type); + + if ($this->Settings->authPlainLine && $SASL instanceof \SnappyMail\SASL\Plain) { // https://github.com/the-djmaze/snappymail/issues/1038 - $SASL = \SnappyMail\SASL::factory('PLAIN'); try { $sResult = $this->sendRequestWithCheck('AUTH', 235, 'PLAIN ' . $SASL->authenticate($sLogin, $sPassword)); @@ -148,8 +149,6 @@ class SmtpClient extends \MailSo\Net\NetClient } } else { // Start authentication - $SASL = \SnappyMail\SASL::factory($type); - try { $sResult = $this->sendRequestWithCheck('AUTH', 334, $type);