Merge branch '4.3' into 4.4

* 4.3:
  [Mailer] fixed error that is masked by another error
  [Mailer] fixed the order of authenticators
This commit is contained in:
Fabien Potencier 2019-08-03 10:59:34 +02:00
commit 87458fc7b8
2 changed files with 8 additions and 4 deletions

View File

@ -36,10 +36,10 @@ class EsmtpTransport extends SmtpTransport
parent::__construct(null, $dispatcher, $logger);
$this->authenticators = [
new Auth\PlainAuthenticator(),
new Auth\LoginAuthenticator(),
new Auth\XOAuth2Authenticator(),
new Auth\CramMd5Authenticator(),
new Auth\LoginAuthenticator(),
new Auth\PlainAuthenticator(),
new Auth\XOAuth2Authenticator(),
];
/** @var SocketStream $stream */

View File

@ -112,7 +112,11 @@ class SmtpTransport extends AbstractTransport
try {
$message = parent::send($message, $envelope);
} catch (TransportExceptionInterface $e) {
$this->executeCommand("RSET\r\n", [250]);
try {
$this->executeCommand("RSET\r\n", [250]);
} catch (TransportExceptionInterface $_) {
// ignore this exception as it probably means that the server error was final
}
throw $e;
}