Skip to content

Commit 8d7c267

Browse files
committed
fix failed login even when it is authenticated in PLAIN authentication
1 parent 60a1e65 commit 8d7c267

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

system/Email/Email.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,10 +2058,13 @@ protected function SMTPAuthenticate()
20582058
$authString = "\0" . $this->SMTPUser . "\0" . $this->SMTPPass;
20592059

20602060
$this->sendData('AUTH PLAIN ' . base64_encode($authString));
2061-
$reply = $this->getSMTPData();
20622061

2063-
if (! str_starts_with($reply, '235') || ! str_starts_with($reply, '503')) {
2064-
$this->setErrorMessage(lang('Email.failedSMTPLogin', [$reply]));
2062+
if (str_starts_with($this->getSMTPData(), '503')) { // Already authenticated
2063+
return true;
2064+
}
2065+
2066+
if (! str_starts_with($this->getSMTPData(), '235')) {
2067+
$this->setErrorMessage(lang('Email.failedSMTPLogin', [$this->getSMTPData()]));
20652068

20662069
return false;
20672070
}

0 commit comments

Comments
 (0)