php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3022 mail() incorrectly parses extra headers
Submitted: 1999-12-21 15:43 UTC Modified: 2000-01-08 06:37 UTC
From: maarten at nl dot linux dot org Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.12 OS: Debian 2.1r2 w/ kernel 2.2.13
Private report: No CVE-ID: None
 [1999-12-21 15:43 UTC] maarten at nl dot linux dot org
This works: mail("maarten", "subj", "body","From: someone <someone@domain.com>");
This doesn't: mail("maarten", "subj", "body","From: some.one <someone@domain.com>");

Note the dot in the 2nd line. The error message my MTA gives me:The following annotated headers illustrate where the error(s) occurred:

Error in "From" header address:

        some.one<someone@domain.com>
                ^-missing end of mailbox


Apparently, mail() leaves out a required space if the "From: " name has a dot in it.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-12-21 16:04 UTC] maarten at nl dot linux dot org
This works: mail("maarten", "subj", "body","From: someone <someone@domain.com>");
This doesn't: mail("maarten", "subj", "body","From: some.one <someone@domain.com>");

 Note the dot in the 2nd line. The error message my MTA gives me:The following annotated
    headers illustrate where the error(s) occurred:

   Error in "From" header address:

          some.one<someone@domain.com>
                         ^-missing end of mailbox


 Apparently, mail() leaves out a required space if the "From: " name has a dot in it.

UPDATE: I use zmailer. sendmail seems to ignore the problem. 
Still, according to RFC822, there should be a space.
 [2000-01-08 06:37 UTC] sas at cvs dot php dot net
The mail() function does not perform any parsing. Your MTA probably rejects it, because the name must be quoted, i.e. "some.one".
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 15:00:01 2026 UTC