-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Steps to reproduce the issue
Send an e-mail with the default Mailer instance. Return Path and envelope-from are not aligned with "From" e-mail header. I noticed this when i was using MailTemplate to send e-mails without passing a custom Mailer to the MailTemplate.
It produces headers like this:
Return-Path: <[email protected]>
(envelope-from <[email protected]>)
From: Example Name <[email protected]>
But when i do a $mailer->setSender() and then pass that to the MailTemplate, It produces these e-mail headers:
Return-Path: <[email protected]>
(envelope-from <[email protected]>)
From: Example Name <[email protected]>
This improves e-mail deliverability because now these domains are aligned with the SPF and the DKIM records. Where before they were not.
Expected result
E-mail header domains aligned
Actual result
E-mail header domains not aligned.
Additional comments
I think the root cause is this line:
| if ($mailer->setFrom($mailfrom, MailHelper::cleanLine($fromname), false) === false) { |
Where as in the Mail class we don't do this:
joomla-cms/libraries/src/Mail/Mail.php
Line 205 in 813bfe8
| $result = $this->setFrom(MailHelper::cleanLine($from[0]), MailHelper::cleanLine($from[1])); |