[wp-trac] [WordPress Trac] #25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names

WordPress Trac noreply at wordpress.org
Sat Nov 26 20:10:11 UTC 2016


#25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names
-------------------------------------------------+-------------------------
 Reporter:  layotte                              |       Owner:
     Type:  defect (bug)                         |  SergeyBiryukov
 Priority:  normal                               |      Status:  reviewing
Component:  Mail                                 |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  has-patch dev-feedback needs-        |     Version:  3.8
  testing                                        |  Resolution:
                                                 |     Focuses:
-------------------------------------------------+-------------------------

Comment (by riasat):

 WP v4.6.1

 My nginx conf server block:


 {{{
 server {
         listen         80;
         server_name    ~^(?<subdomain>.+?)\.(?<domain>.+)$;
         root  /var/www/$subdomain;
         include conf.d/server_block_common.cnf;
 }

 }}}

 This is what I always get:

 {{{
 Fatal error:  Uncaught phpmailerException: Invalid address:
 wordpress@~^(?<subdomain>.+?)\\.(?<domain>.+)$ in
 }}}


 I know I can fix it by using "wp_mail_from" but I still don't get it why
 you can not simply default to "wordpress at site-domain.come" or even just
 give an OPTION in settings to set the SEND FROM field. It is ridiculous
 that people have to resort to code if they want to change wordpress
 portion of the SEND FROM field.

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


More information about the wp-trac mailing list