You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #33967 multiple Mailer Transports were adapted to use $sentMessage->setMessageId(<final Message ID>);.
Among them SesApiTransport and SesHttpTransportbut SesSmtpTranspor was not: It still provides the original Message-id (set by Symfony itself).
Since symfony/mailer is often used to abstract transport-specific logic it may easily result in errors where the return value is not the expected one. (In my case I need to check for actual deliverability against AWS SNS service what can only work if I stored the AWS-issued Message-ID)
drzraf
changed the title
[Mailer][Amazon] SMTP transport does not provide the Message-ID
[Mailer][Amazon] SMTP transport does not provide the (final) Message-ID
May 11, 2022
…ailable (Raphaël Droz)
This PR was squashed before being merged into the 6.2 branch.
Discussion
----------
SMTP Transport to provide the (final) Message-ID if available
bug #46323 [Mailer] SMTP transport does not provide the (final) Message-ID
| Q | A
| ------------- | ---
| Branch? | 6.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#46323
| License | MIT
| Doc PR | symfony/symfony-docs#
Questions / Answers:
- **Q**: Why storing 250 inside **`$mtaResult`** instead of using the already available `$message->getDebug()`?
- A: Because the later may be huge (especially in case of attachment) and running a regexp over it would be less than safe. Instead `$mtaResult` only contains one line
- **Q**: Why a new **`public`** method?
- A: Because child SMTP Transport may make other assumptions about the return `250 Ok` value and provide a custom logic / regexp.
- **Q**: Why **regexp**?
- A: Because there is no official standard for this line (other than the `250 Ok` prefix)
Additionally (see https://symfony.com/releases):
- [ ] Always add tests and ensure they pass. _I can't. Don't have the time. Left to maintainers / other contributors_
- [x] Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.)
- [x] Features and deprecations must be submitted against the latest branch.
- [x] Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- [x] Never break backward compatibility (see https://symfony.com/bc).
Commits
-------
441c9b0 SMTP Transport to provide the (final) Message-ID if available
Symfony version(s) affected
6.1.0
Description
In #33967 multiple Mailer Transports were adapted to use
$sentMessage->setMessageId(<final Message ID>);
.Among them
SesApiTransport
andSesHttpTransport
butSesSmtpTranspor
was not: It still provides the original Message-id (set by Symfony itself).Since
symfony/mailer
is often used to abstract transport-specific logic it may easily result in errors where the return value is not the expected one. (In my case I need to check for actual deliverability against AWS SNS service what can only work if I stored the AWS-issued Message-ID)How to reproduce
MAILER_DSN=ses+smtp://foo:bar@default?region=eu-west-1
Possible Solution
As per https://docs.aws.amazon.com/ses/latest/dg/troubleshoot-smtp.html
The Message-Id is returned as part of the
250 Ok
response to theDATA
SMTP command.The text was updated successfully, but these errors were encountered: