[wp-trac] [WordPress Trac] #49687: wp_mail() - Why is no envelope sender defined?
WordPress Trac
noreply at wordpress.org
Tue Oct 21 07:40:13 UTC 2025
#49687: wp_mail() - Why is no envelope sender defined?
--------------------------------------------+-----------------------
Reporter: vbbp | Owner: SirLouen
Type: enhancement | Status: accepted
Priority: normal | Milestone: 6.9
Component: Mail | Version: 5.4
Severity: major | Resolution:
Keywords: has-test-info has-patch commit | Focuses:
--------------------------------------------+-----------------------
Comment (by dmsnell):
After considerable help from @stankea and @websupporter we have confirmed
a few things, most notably a confirmation that this patch should be
appropriate.
- In `trunk` the Sender/Envelope From is being set incorrectly due to the
`false` flag. It’s likely picking up an unreachable hostname from the mail
server.
- With the patch WordPress //by default// is using the domain “where the
front end is accessible” and `wordpress` as the user.
This is generally correct. //However// there might be one case where this
breaks existing sites: //if// the site has a SPF which does not allow
sending emails on behalf of this site domain, then other mail hosts might
start rejecting emails from it where they may have let through the
previously-configured host. Granted, //this is an odd configuration// and
for sites where //advanced mail setup has already taken place//. It is
likely that if someone configures SPF they will probably add the
appropriate domain in the policies. Even then, if the site has a working
DKIM+DMARC configuration it will likely bypass this SPF failure.
All in all it seems like this is an appropriate change, and should
anything drastic come up we can always revert. I will be merging this now.
Thank you everyone for your help, reporting, testing, explanations, and
double-checking.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49687#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list