Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mail][Messenger] losing email's transport header on error #44741

Closed
@Nommyde

Description

@Nommyde

Symfony version(s) affected

5.4

Description

When an email is sent through the messenger using alternative mail transport and if this mail transport fails then modified email is pushed to the queue for the next try (without X-Transport header). The second try takes default mail transport whether you want it or not.

How to reproduce

https://github.com/Nommyde/mailer-messenger-bug

run:

php bin/console app:send-email -vvv              # an email pushed to the queue
php bin/console mes:consume async --limit=1 -vvv # error on the second transport
php bin/console mes:consume async --limit=1 -vvv # success on the first transport

Possible Solution

In this case I believe the method \Symfony\Component\Mailer\Transport\Transports::send should clone a message before modifying and sending it.

Additional Context

No response

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