[wp-trac] [WordPress Trac] #49687: wp_mail() - Why is no envelope sender defined?
WordPress Trac
noreply at wordpress.org
Sat Aug 9 15:21:14 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: has-test-info has-patch | Focuses:
-------------------------------------+------------------------------
Comment (by siliconforks):
Replying to [comment:24 SirLouen]:
> But this was sorted in 2021 and there are no references to any issues
(later was refined)
>
https://github.com/PHPMailer/PHPMailer/commit/f9f5b8d21ed2b79fe2e660f2c0ae9c676e30210c
I confess I'm not sure I understand what that commit is doing, but I don't
think that's related to the issue I'm talking about? I think the issue
with multiple `-f` options still exists.
These are the steps I'm doing for testing:
1. Install WordPress with [https://github.com/WordPress/wordpress-
develop/pull/9412 PR #9412]
2. Create a file `fakesendmail.sh` with the following code:
{{{
#! /bin/sh
dir=$(dirname $0)
log="$dir/fakesendmail.log"
echo "$0" >> "$log"
for i in "$@"
do
echo " $i" >> "$log"
done
}}}
3. Edit your `php.ini` file and change `sendmail_path` to point to the
`fakesendmail.sh` script and add an `-f` option:
{{{
sendmail_path = /srv/fakesendmail/fakesendmail.sh -fphp.ini at example.test
}}}
4. Send an email using WordPress (e.g., using the forgot password
functionality). You should find the following in your `fakesendmail.log`
file:
{{{
/srv/fakesendmail/fakesendmail.sh
-fphp.ini at example.test
-fwordpress at example.test
}}}
You can see that WordPress is executing the command with two `-f` options.
My concern is that maybe this is what was happening in #37736 and we might
just see a repeat of the same thing all over again?
(Or possibly #37736 was something else. The reports are so vague - "some
hosts do not allow the use of this flag", "fail on some server
environments", etc. - that it's hard to tell what was actually the
problem.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49687#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list