WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#40259 closed defect (bug) (duplicate)

The envelope-from address is being explicitly unset/set to nothing (or phpmailer is too far out of date)

Reported by: lilmike Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Mail Keywords:
Focuses: Cc:

Description

Hi,
First a little background: My mail system (postfix, running on arch linux), is set to send mails from certain domains through an email deliverability service. However, when WordPress sends an email from any domain, it tries to go through that provider, even if the domain was not set up (either with postfix or the mail provider). A little digging showed that the envelope-from address was "http", or the user php is running as. This caused postfix to add the myohstname parameter to the username, getting http@<myserverdomain>. It just so happened that postfix was set up to send email from anything@<myserverdomain> through this email deliverability service, so I don't get important server notices stuck in junk (or worse, limbo). Per an issue raised on php mailer's github (https://github.com/PHPMailer/PHPMailer/issues/995), the problem seems to be with WordPress -- the default behavior of php mailer is to set the envelope-from address to the from: address (if not provided). So somehow WordPress is overriding this behavior, or using a too out-of-date version.
-Michael.

Change History (1)

#1 @swissspidy
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from 4.6 to 3.8

Hey there,

Welcome to Trac!

When $from_email is not set in wp_mail(), WordPress uses $_SERVER['SERVER_NAME'] to and ends up using wordpress@<servername> when calling PHPMailer::setFrom(), which in turn sets the Sender property. This property is used to set the SMTP envelope.

To me that sounds like the problem you're experiencing, which there luckily is already a ticket for, see #25239.

Note: See TracTickets for help on using tickets.