[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
Fri Apr 15 13:16:56 UTC 2016
#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: high | Milestone: Future Release
Component: Mail | Version: 3.4.2
Severity: major | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+-----------------------------
Comment (by cbutlerjr):
I can see the possibility of changing this so that in the default
everything matches. However, there's not a need to modify the function
(pluggable or otherwise) as @kellogg9 mentioned. The phpmailer settings
can be handled with the phpmailer_init action.
phpmailer_init fires after PHPMailer is initialized. So the action can be
used to cleanup any settings as needed. I believe that until a full fix
is in place, the following would patch it:
{{{
add_action( 'phpmailer_init', 'my_phpmailer_dkim_cleanup' );
function my_phpmailer_dkim_cleanup( $phpmailer ) {
if ( '' == $phpmailer->Sender ) {
$phpmailer->Sender = $phpmailer->From;
$phpmailer->AddReplyTo( $phpmailer->From );
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22837#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list