[wp-trac] Re: [WordPress Trac] #2053: Emails being sent with bogus "From:" header

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 20 16:56:46 GMT 2007

#2053: Emails being sent with bogus "From:" header
 Reporter:  sjmurdoch         |        Owner:  rob1n      
     Type:  defect            |       Status:  reopened   
 Priority:  normal            |    Milestone:  2.3 (trunk)
Component:  General           |      Version:  2.2.1      
 Severity:  major             |   Resolution:             
 Keywords:  has-patch commit  |  
Changes (by Otto42):

  * status:  closed => reopened
  * version:  2.0 => 2.2.1
  * resolution:  fixed =>
  * milestone:  2.2 => 2.3 (trunk)


 The pluggable.php contains this code in wp_notify_postauthor():

 `$wp_email = 'wordpress@' . preg_replace('#^www\.#', '',

 This is done because it builds its own headers and sends them to wp_mail.
 The end result of this is that the wp_mail_from filter is not applied in
 this case, because $headers != ''.

 Suggest changing the code above in wp_notify_postauthor() to this:

 `$wp_email = apply_filters('wp_mail_from', "wordpress@" .
 preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])));`

 In order to apply the same wp_mail_from filter to these email addresses as

Ticket URL: <http://trac.wordpress.org/ticket/2053#comment:12>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list