[wp-trac] [WordPress Trac] #52822: PHPMailer change in WordPress 5.7 breaks working sites

WordPress Trac noreply at wordpress.org
Sat Mar 27 16:31:04 UTC 2021


#52822: PHPMailer change in WordPress 5.7 breaks working sites
-------------------------------------+---------------------
 Reporter:  tigertech                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  high                     |   Milestone:  5.7.1
Component:  Mail                     |     Version:  5.7
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+---------------------

Comment (by tigertech):

 Replying to [comment:11 galbaras]:
 > Actually, the `-f` flag is only used when `!empty($this->Sender)`, which
 means that when there's no sender, the defaults should still work.

 That unfortunately isn't the case because of
 [https://github.com/PHPMailer/PHPMailer/commit/09bc3065290431cad8c345b852386789ca852396
 #diff-7f9ff1e59fad629c10da93f0d676eadc5ec86634c576f9852a41e8dba6f8afad
 line 1684 here]:

 {{{
         if ('' === $this->Sender) {
             $this->Sender = $this->From;
         }
 }}}

 That effectively makes "$this->Sender" never be empty in the check you're
 mentioning.


 >Either way, this forum isn't about phpMailer. It's about WordPress, and
 changes to phpMailer are outside the scope of the discussion.

 My apologies that I wasn't clear. When I said that a complete fix would be
 to reverse the changes in PHPMailer that cause "-f" to now be passed from
 wp_mail() when it previously wasn't, I meant that such a change could be
 made in the copy shipped with WordPress. However, I'm aware that patching
 it again is an unpleasant option.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52822#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list