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

Skip to content

[Mailer] Reorder headers used to determine Sender #37888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

cvmiert
Copy link

@cvmiert cvmiert commented Aug 19, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Use the Return-Path header as the last candidate to determine the Envelope's sender address.

The Return-Path is usually configured in addition to the Sender and/or From header: it allows for email bounces and complaints to be sent to a dedicated email address. It should therefor not be used as the first candidate header to determine the sender.

@cvmiert cvmiert marked this pull request as ready for review August 19, 2020 16:07
@cvmiert
Copy link
Author

cvmiert commented Aug 19, 2020

I noticed the failed Travis build, but the failing tests seem unrelated to the changes in this PR. I'm not sure how I can address that. Can anyone advise please?

@cvmiert cvmiert force-pushed the mailer/fix-sender-from-headers branch from 77f595f to 6648be4 Compare August 19, 2020 17:00
Use the `Return-Path` header as the last candidate to determine the
Envelope's sender address.

The `Return-Path` is usually configured _in addition_ to the `Sender`
and/or `From` header: it allows for email bounces and complaints to be
sent to a dedicated email address. It should therefore not be used as
the first candidate header to determine the sender.
@cvmiert cvmiert force-pushed the mailer/fix-sender-from-headers branch from 6648be4 to 7e60a8f Compare August 19, 2020 17:05
@fabpot fabpot changed the base branch from master to 4.4 August 19, 2020 17:15
@fabpot
Copy link
Member

fabpot commented Aug 19, 2020

Thank you @cvmiert.

@fabpot fabpot merged commit 3c270fb into symfony:4.4 Aug 19, 2020
@cvmiert cvmiert deleted the mailer/fix-sender-from-headers branch August 21, 2020 14:16
This was referenced Aug 31, 2020
@xabbuh xabbuh added this to the 4.4 milestone Aug 31, 2020
@cscrewsandcaptains
Copy link

You wrote in the introductory comment:
"The Return-Path is usually configured in addition to the Sender and/or From header: it allows for email bounces and complaints to be sent to a dedicated email address. It should therefor not be used as the first candidate header to determine the sender."

You are correct that the "return-path" is set in addition to the "sender" and/or "from". And it is used for bounces of emails. You are also right that "return-path" should not be used as the first header candidate to determine the sender.

But please don't use "return-path" as the last candidate. The last one must be "from". "from" is alway set and thus is the last candidate.
If you want to use bounces, set the "return-path". And in this case, the sender must be the "return-path" email, not the "from" email. And only if the "sender" header is set, it will override the "return- path".
I am not sure if this is correct for all email daemons, but for sendmail it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants