Opened 8 years ago
Closed 8 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: | 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.
Hey there,
Welcome to Trac!
When
$from_email
is not set inwp_mail()
, WordPress uses$_SERVER['SERVER_NAME']
to and ends up usingwordpress@<servername>
when callingPHPMailer::setFrom()
, which in turn sets theSender
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.