[5.4] Fix for envelope-from & return path alignment with From in MailTemplateFactory #46431
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Pull Request for Issue #46419.
Summary of Changes
Remove the false flag for "auto" on the setFrom method from PHPMailer in the MailTemplateFactory. This will improve the standard Joomla e-mail deliverability because now the Return-Path, envelope-from and From are aligned.
By default Joomla was setting this "auto" flag to false. Although PHPMailer's default is "true".
The behaviour won't change for reply-to. E-mail clients already use From as the fallback if there is no reply-to set.
Bounces now are sent to the wrong place for instance [email protected] instead of the "from mail" set in the configuration, this fix solves that issue.
With this fix SPF and DMARC domains will now be aligned and with that improve e-mail deliverability.
Testing Instructions
Set your "Mailer" to PHP Mail in Global Configuration -> Server -> Mail -> Mailer
Send an e-mail using the test e-mail from the configuration or do a lost password check.
Check e-mail headers and see that headers don't align.
Actual result BEFORE applying this Pull Request
Return-Path and envelope-from DON'T match the From.
Expected result AFTER applying this Pull Request
Return-Path and envelope-from DO match the From.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed