Space a valid delimiter for email addresses in email header?

5,625

Solution 1

According to RFC 5322 the correct delimiter for recipients in the To: header is the comma ,.

address-list = (address *("," address)) / obs-addr-list

Solution 2

Edit: My answer was very, very wrong.

The SMTP specification requires each recipient on separate RCPT TO: commands;

HELO domain.com
MAIL FROM: [email protected]
RCPT TO: [email protected]
RCPT TO: [email protected]
DATA

(etc)

Share:
5,625

Related videos on Youtube

semanticalo
Author by

semanticalo

Updated on September 17, 2022

Comments

  • semanticalo
    semanticalo over 1 year

    Is it syntactically correct to delimit multiple email recipients in the "To" header of an email with spaces only or do I need to use another delimiter (a semicolon or the like)?

    Example (MIME data reads as follows):

    Date: Mon, 04 Oct 2010 06:14:16 +0200
    From: [email protected]
    To: [email protected] [email protected] [email protected]
    Subject: Test Subject
    

    The above will be processed by many email processing applications, but I need to know whether it's correct according to standard (RFC). Unfortunately I didn't find anything useful on the internet so far.

    Thanks a million for your help!

    • Caleb
      Caleb over 13 years
      As pauska noted in his edit, the RFC that describes how SMTP servers talk to eachother requires that recipients be expressed on separate lines behind their own RCPT command. However it is not clear to me that this is the question you are asking because the mime header data you show is not the chat between SMTP servers but your little package that you feed into a mailer that then interprets that and does all the SMTP talk with other mail servers according to RFC's for you. Can you clarify which part of that pipeline you are working with?
    • semanticalo
      semanticalo over 13 years
      Thanks, Caleb. I mean the MIME data syntax that i.e. an email application receives. If this contains multiple email addresses separated by a space, most email applications process it as e.g. three email addresses, but I need to check whether this is correct or just some kind of tolerance for incorrect syntax.
  • semanticalo
    semanticalo over 13 years
    Thanks for your reply! I think it didn't come clear enough from my question that I'm looking for an answer on the RFC 5321/2 side of things, because I receive emails that have email addresses delimited with nothing but a space and want to know for sure whether that's correct according to specification or not.
  • pauska
    pauska over 13 years
    Oh. I don't know how it's presented on the viewers side of things. Good luck!