ietf-smtp
[Top] [All Lists]

Re: Parsing a header

2007-12-03 12:13:15

Paul Smith wrote:
 
From: Joe \(Joseph\) Bloggs <joe(_at_)joe(_dot_)com>
 
My reading of RFC 2822 says that this is three "tokens", 'Joe',
'\' and an unfinished comment '(Joseph) Bloggs <joe(_at_)joe(_dot_)com>'

I think it's "Joe" followed by a syntax error, how you resume
parsing after an error, e.g. arriving at "unfinished comment",
not at all, or ignoring an invalid quoted-pair, isn't specified.

the '\' before the '(' isn't a quoting '\' but a real '\'.

The real backslash is a real syntax error at this place.

Outside comments you use " characters for quoting.

Quoted pairs can also appear within quoted strings, or in
domain-literal, maybe more, not only in comments.  And
quoted strings aren't allowed everywhere, e.g. not as a
domain-literal, domain-literals use square brackets.

syntactically correct formations of the line could be:
 
From: "Joe (Joseph) Bloggs" <joe(_at_)joe(_dot_)com>
or
From: (Joe \(Joseph\) Bloggs) joe(_at_)joe(_dot_)com
or even
From: Joe (\(Joseph\)) Bloggs <joe(_at_)joe(_dot_)com>

Or From: "Joe \(Joseph\) Bloggs" <joe(_at_)example>
or From: Joe (Joseph) Bloggs <joe(_at_)example>

Using the new 2821bis style of a TLD address,
we're on the SMTP list... :-)

 Frank

<Prev in Thread] Current Thread [Next in Thread>