[Mailman-Users] Spaces in Email Addresses (the nightmare continues)

John Price jp_mailman at gcfl.net
Tue Aug 24 05:20:11 CEST 2004

On Tue, Aug 24, 2004 at 12:11:31AM +0200, Brad Knowles wrote:
> At 3:53 PM -0500 2004-08-23, John Price wrote:
> > Actually, according to RFC822 (section 3.4.1), spaces are
> > allowed in email addresses:
> 	RFC 822 has been superceded for quite some time.  See 
> <http://www.rfc-editor.org/rfc/rfc2822.txt> instead.  The wording is 
> more difficult for me to read, but from what I've been able to gather 
> so far, the use of space characters is no longer allowed.

I've been studying RFC2822, and it's even nastier than I
originally thought. :(

Basically, the local part of an email address is called
the "local-part" (sec 3.4.1).  The local-part can be one
of three things: dot-atom, quoted-string, or

A quoted-string is defined as optional white-space, a
quote, zero or more combinations of white space and qtext
or a quoted pair(s), and finally a quote and optionally
more white space (although there is a note that RFC2822
does not allow white space between the local part and the
'@' character). (sec 3.2.5)

qtext is defined as ASCII characters 33, 35-91, 93-126
(not space, '@' or '\'). (sec 3.2.5) A quoted-pair is a
backslash ('\') followed by any of these ASCII characters:
1-9, 11-12, 14-127 (all characters excluding NULL, CR and
LF). (sec 3.2.2)

This means you can have spaces in email addresses.
Control characters are also allowed (except NULL, CR & LF)
if they are escaped by a backslash.

If the local-part is a quoted-string, it can also span
multiple lines in the headers! So for example, this is

From: "some really long
 crazy address"@domain.com
Subject: Check out the email address my idiot sys admin gave me!

The From address should be converted to an actual email
address that looks like this internally:

some really long crazy address at domain.com

I can see some idiot sys admin now dreaming of a way to
assign someone an email address that has a bunch of
backspace characters in it...  But how the hell do you
type that into a web form or your email program?  If they
really wanted that ability, why wouldn't they escape them
like C does, i.e. "\x08" for a backspace.

If they were going to obsolete RFC822, why would they
leave all this in there???  Who needs control characters
in any email, period?

Pounding head on desk,

Monday is an awful way to spend 1/7th of your life.

Have a great day and don't forget to laugh!

http://www.gcfl.net (The Good, Clean Funnies List): Good,
clean daily funnies you can safely tell your mom!

More information about the Mailman-Users mailing list