-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Mailer return path is not set correctly #41322
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
Comments
To clarify: Do you mean that the issue does only exist in 4.4 and has been fixed in 5.1? |
exist in 4.4 fixed in 5.0.6 |
Any help ? |
Hey, thanks for your report! |
Hi no i did not find a workaround and it is still relevant. Some help would be really nice because as I said in new version it is fixed. |
Would you be able to contribute a test case for the Mailer component that succeeds with 5.1 but fails on 4.4? That could make it easier for someone else to contribute a fix for this issue. |
Sorry but i don't have such a skills i only tried it with such a versions of mailer component and I know where it works and where it doesn't that is all, but I can not update to 5.1 because of other packages in my project |
Hi i find out it was last time working in 5.1.3.
as you can see it is only changed the order... Correct one is how it was in 5.1.3 I tried to change it in 5.1.4 (and also 5.4.3) manually and it is working. I don't know what it does exactly but changing order helped. |
mailer info was ignoring return-path setting more info here symfony#41322
I don't get the issue. The method you are referring to does not change anything to the Return-Path, it uses its value for the sender. As the Return-Path is used for SPF, many providers are actually overriding the Return-Path automatically. |
hi issue is we wanted to use return path because of bounced emails. as i
know that is the reason why this exists, ir am i wrong?
but now it is always replaced by sender email.
Dňa pi 25. 2. 2022, 8:32 Fabien Potencier ***@***.***>
napísal(a):
… I don't get the issue. The method you are referring to does not change
anything to the Return-Path, it uses its value for the sender. As the
Return-Path is used for SPF, many providers are actually overriding the
Return-Path automatically.
—
Reply to this email directly, view it on GitHub
<#41322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEENRIIN6C3HHT7DOCQEZDU44V7XANCNFSM45GQL7WQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Are you sure that the Return-Path header is not overridden by your email provider? |
i think it is not. because when i change order in that function as i
suggested i can see it in source of the email. so i think it is bug on
symfony side not my provider
Dňa so 26. 2. 2022, 11:28 Fabien Potencier ***@***.***>
napísal(a):
… Are you sure that the Return-Path header is not overridden by your email
provider?
—
Reply to this email directly, view it on GitHub
<#41322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEENRKL2FRTBQJNOM6PCKTU5CTNVANCNFSM45GQL7WQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello, we have discovered the same behavior as peteruu said. When we set the return path via $mail->returnPath(), it is ignored. The return path in the email header is set to the from property. We didn't set the from property because we want to receive bounce mails to our bounce mail address. The fix from peteruu seems to be correct. Perhaps it would be helpful if there was a comment on this function describing the order of the properties (returnPath, sender, from) so that they remain the same in the future. Is there a plan to include the fix in a release? |
Hi, After switching from swiftmailer to symfony mailer, the problem appeared. We have not changed anything else. To clarify: The function that peteruu suggests to change is indirectly called to set the parameter -f in the sendmail command (which corresponds to the sender in the sendmail documentation). It may be that sendmail then replaces the email header "Return-Path" with this address (this seems correct to me). Current workaround: Set "Sender", leads to: "Sender" and "From" being displayed in the email programme :( If this function is used elsewhere, it may be necessary to create a second function that corresponds to the function of peteruu. |
@fabpot so as you can see also other people face the same issue. Is there any idea how to make it work? |
peteruu I think your fix is not quite correct. Please refer to my last comment on your pull request (#45545). |
In Swiftmailer, the order is what we had initially in Symfony Mailer: "return path" then "sender" then "from". As we never had any complaints about this in Swiftmailer, I suppose that reverting #45545 might be the "best" solution. |
I would love to have references from other mailer libraries (PHP or any other language) to check what they are doing. |
I've experienced the bug also by switching from Swiftmailer to Symfony Mailer. The pull request #45545 did change the behaviour, and Swiftmailer was more correct. The problem is some mail servers will ignore the The correct ordering would either be
I found these references on how to order the addresses correct:
|
…ess than From address (tpetry) This PR was merged into the 4.4 branch. Discussion ---------- [Mailer] Return-Path has higher priority for envelope address than From address | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #41322 | License | MIT | Doc PR | - Commits ------- 4945059 fix: return-path has higher priority for envelope address than from address (fixes #41322)
Can you please put it also into 5.4 branch. There is the same problem. |
Won't the fix be ported to newer versions somehow in the process @fabpot? I was asked to provide the bugfix to 4.4 instead of 6.x which I am using. I expected the bug to trickle-up in the release process, is this valid? |
yeah, the fix will be merged up by the core team in the next merge up |
* 4.4: [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Use reference date in reverse transform Fixes #40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share #45990 [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes #41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator [DependencyInjection] Add TaggedIteratorArgument unit tests
* 5.4: (21 commits) Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes #40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share #45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes #41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests [Process] Fix Process::getEnv() when setEnv() hasn't been called before ...
* 6.0: (22 commits) Add missing license header Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes #40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share #45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes #41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests ...
@tpetry, just a note that PHPMailer dropped support for the Return-path header in 2014.
I don't think that is PHPMailer. Adding the return-path header at the point of sending contravenes the RFCs:
Because of this, PHPMailer no longer sets the header: |
Just to maybe save someone some headache. This broke our application as Sparkpost is using Return-path for bounced emails which are different then the header. |
* 4.4: [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Use reference date in reverse transform Fixes symfony#40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share symfony#45990 [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes symfony#41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator [DependencyInjection] Add TaggedIteratorArgument unit tests
* 5.4: (21 commits) Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes symfony#40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share symfony#45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes symfony#41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests [Process] Fix Process::getEnv() when setEnv() hasn't been called before ...
* 6.0: (22 commits) Add missing license header Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes symfony#40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share symfony#45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes symfony#41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests ...
Symfony version(s) affected: 4.4.16
Description
When we create a email with defined ->returnPath('[email protected]') email is delivered but in email source we can see that return path was replaced by ->from('[email protected]') We tried to upgrade this component to v5.0.6 and also v5.0.9 both versions are working correctly. WE was using our server DSN and also tried this setting: MAILER_DSN=sendmail://default without change
How to reproduce
Just sent a email with setup "returnPath" and returnPath should be in your mailbox replaced with "from"
Possible Solution
probably something in suggested versions
The text was updated successfully, but these errors were encountered: