Skip to content

[Mailer][Amazon] SMTP transport does not provide the (final) Message-ID #46323

@drzraf

Description

@drzraf

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 and SesHttpTransport but 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)

How to reproduce

MAILER_DSN=ses+smtp://foo:bar@default?region=eu-west-1

$mailer->send($message);
echo $mailer->getMessageId();

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 the DATA SMTP command.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions