[wp-trac] [WordPress Trac] #28473: wp_mail incorrectly parses multiline From header

WordPress Trac noreply at wordpress.org
Tue Sep 9 16:49:39 UTC 2025


#28473: wp_mail incorrectly parses multiline From header
-------------------------------------------------+-------------------------
 Reporter:  arty.name                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Mail                                 |     Version:  3.9.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests changes-    |     Focuses:
  requested                                      |
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 @sainathpoojary I have reviewd this ticket
 It has a problem we cannot solve for now

 We are working currently in a patch in #62940 that must introduce
 `parseAddresses`
 For this reason we won't need this part:

 {{{
 if ( function_exists( 'mb_decode_mimeheader' ) && ( str_contains(
 $content, "\n" ) || str_contains( $from_name, '=?' ) ) ) {
 $from_name = mb_decode_mimeheader( $from_name );
 }}}

 Also for the test, just focus on the multiline part, ignore the single
 line tests

 The first part looks good to me.

 Once we have #62940 merged, we will be able to pass
 `test_wp_mail_multiline_header`. So I'm going to leave this patch in
 stand-by. If you want for now, you can simply clean it (I've added some
 reviews within the PR)

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


More information about the wp-trac mailing list