WordPress.org

Make WordPress Core

Opened 9 months ago

Closed 4 months ago

#43878 closed enhancement (duplicate)

Allow wp_mail to set Sender field when setting From

Reported by: bastho Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: Mail Keywords: has-patch
Focuses: Cc:

Description

[38287] forces PHPMailer's setFrom() to don't set Sender field.

It seems to improve compatibility on some server environments, but it's a regression on those which support -f option. On these ones, the Sender is something like www-data@host which can cause SPF failure if the server name doesn't match the domain name (which occurs pretty often).

While this setting is very dependent of the server environment, I suggest to add a constant WP_MAIL_AUTO_SENDER to determine the expected behavior.

Attachments (1)

43878.patch (1.3 KB) - added by bastho 9 months ago.

Download all attachments as: .zip

Change History (3)

@bastho
9 months ago

This ticket was mentioned in Slack in #core by bastienho. View the logs.


4 months ago

#2 @SergeyBiryukov
4 months ago

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

Hi @bastho, thanks for the ticket and the patch!

We're already tracking this issue in #25239.

Note: See TracTickets for help on using tickets.