Skip to content

Commit

Permalink
bug #30787 [Mailer] Fix SMTP support when a message cannot be sent (f…
Browse files Browse the repository at this point in the history
…abpot)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mailer] Fix SMTP support when a message cannot be sent

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

Commits
-------

3d25c1c [Mailer] fixed SMTP support when a message cannot be sent
  • Loading branch information
fabpot committed Mar 30, 2019
2 parents 086f4a2 + 3d25c1c commit c128d50
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -111,7 +111,13 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM
$this->start();
}

$message = parent::send($message, $envelope);
try {
$message = parent::send($message, $envelope);
} catch (TransportExceptionInterface $e) {
$this->executeCommand("RSET\r\n", [250]);

throw $e;
}

$this->checkRestartThreshold();

Expand Down

0 comments on commit c128d50

Please sign in to comment.