[wp-trac] [WordPress Trac] #49687: wp_mail() - Why is no envelope sender defined?
WordPress Trac
noreply at wordpress.org
Sun Aug 3 21:38:17 UTC 2025
#49687: wp_mail() - Why is no envelope sender defined?
---------------------------+------------------------------
Reporter: vbbp | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: 5.4
Severity: major | Resolution:
Keywords: needs-testing | Focuses:
---------------------------+------------------------------
Changes (by SirLouen):
* keywords: dev-feedback needs-testing => needs-testing
* severity: minor => major
Comment:
After some research, not having Sender "enabled" doesn't mean that the
deliverability is not guaranteed. With proper handling of the `From:`
header, things could work as if there was a `Sender`
There are multiple workarounds: one is directly using `sendmail` hooking
via `phpmailer_init` and adding `$phpmailer->isSendmail()` (which
essentially is going to be the same as using the default function, but
without the passthrough).
The problem here is that, by default, the `wp_mail` takes PHP's default
with `isMail`, which is not bad, but by default, PHPMailer doesn't help
using the headers as it does with `sendSendMail` (with the `-t`
parameter).
I've reported this upstream
https://github.com/PHPMailer/PHPMailer/issues/3186 (if this is implemented
it might partially alleviate this problem).
But still, as many of you have suggested, I can't see a reason not to use
`-f` which is the best to ensure the best result, maximizing
deliverability in all scenarios. Unfortunately, [38286] doesn't really
explain which was the exact reproduction scenario where the problem
occurred with `-f` leaving it to pure speculation. Now, most maintainers
will be completely afraid of reverting this change, "just in case there is
a regression."
Personally, what I would suggest here is testing the major systems:
`qmail`, `postfix` wrapper, and `sendmail` itself, and seeing whether this
is still reproducible or not.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49687#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list