[wp-trac] [WordPress Trac] #65415: WordPress 7.0 inclusion of PHPMailer 7.0.2 breaks .user.ini override of sendmail_from

WordPress Trac noreply at wordpress.org
Fri Jun 5 01:11:30 UTC 2026


#65415: WordPress 7.0 inclusion of PHPMailer 7.0.2 breaks .user.ini override of
sendmail_from
--------------------------+-----------------------------
 Reporter:  gmariani405   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Mail          |    Version:  7.0
 Severity:  critical      |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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
 <?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);
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65415>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list