[wp-trac] [WordPress Trac] #22837: WP Needs to Set "Sender" and "Reply-To" or DKIM/DMARC will not work using wp-mail (via PHPMailer)
WordPress Trac
noreply at wordpress.org
Sun Dec 9 19:52:57 UTC 2012
#22837: WP Needs to Set "Sender" and "Reply-To" or DKIM/DMARC will not work using
wp-mail (via PHPMailer)
--------------------------+------------------------------
Reporter: kellogg9 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: 3.4.2
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------------------
Changes (by scribu):
* severity: critical => normal
Old description:
> I notice that for DKIM to function (while using DMARC) correctly for
> outgoing mail the PHPMailer object needs to make sure the Sender and
> Reply-To fields match the "From" field otherwise the "Return-Path" header
> uses the server it is sending from causing a mismatch. When this happens
> DKIM fails authentication on the receiver side because it is not added to
> outgoing mail.
>
> I tried adding the reply-to and sender header manually to wp_mail() but
> it did not work. One had to do the following:
>
> Right now i have to manually modify the /wp-includes/pluggable.php file
> in the wp_mail() function to include:
>
> if (strlen($phpmailer->Sender)==0)
> {
> $phpmailer->Sender = $phpmailer->From;
> $phpmailer->AddReplyTo($phpmailer->From);
> }
>
> This resolves the problem and DKIM works again.
New description:
I notice that for DKIM to function (while using DMARC) correctly for
outgoing mail the PHPMailer object needs to make sure the Sender and
Reply-To fields match the "From" field otherwise the "Return-Path" header
uses the server it is sending from causing a mismatch. When this happens
DKIM fails authentication on the receiver side because it is not added to
outgoing mail.
I tried adding the reply-to and sender header manually to wp_mail() but it
did not work. One had to do the following:
Right now i have to manually modify the /wp-includes/pluggable.php file in
the wp_mail() function to include:
{{{
if (strlen($phpmailer->Sender)==0)
{
$phpmailer->Sender = $phpmailer->From;
$phpmailer->AddReplyTo($phpmailer->From);
}
}}}
This resolves the problem and DKIM works again.
--
Comment:
Note that functions in pluggable.php are called pluggable because you can
re-define them in a plugin, so that you don't have to hack Core.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22837#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list