This commit is contained in:
the-djmaze 2023-03-21 19:08:17 +01:00
parent 30c95ac04e
commit b5356a4115

View file

@ -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);