Opened 6 weeks ago
Last modified 2 weeks ago
#65415 new defect (bug)
WordPress 7.0 inclusion of PHPMailer 7.0.2 breaks .user.ini override of sendmail_from
| Reported by: | gmariani405 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.2 |
| Component: | Version: | 7.0 | |
| Severity: | critical | Keywords: | dev-feedback 2nd-opinion |
| Cc: | Focuses: |
Description
I have created a ticket on PHPMailer here: https://github.com/PHPMailer/PHPMailer/issues/3342
But the gist is, the recent patch in PHPMailer 7.0.2 prevents the .user.ini from overriding an existing -f flag in the sendmail command. Which prevents sites from fixing the incorrect domain on certain hosts (like Nexcess/LiquidWeb) and causing all mail to no longer be deliverable. I have a workaround for now with this simple patch, but ideally PHPMailer needs to be fixed in order to allow the flexibility to override the default sendmail command.
Here is my workaround:
<?php add_action('phpmailer_init', function ($phpmailer) { $phpmailer->isSendmail(); $sendmail_from_value = ini_get('sendmail_from'); if (empty($sendmail_from_value)) return; $phpmailer->Sender = $sendmail_from_value; }, 999);
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Putting in the 7.0.1 milestone for tracking, but fixing this will be dependent on an upstream release