Hi David -

You didn't look closely enough at the offending message.  I probably
wouldn't have caught it either if it weren't for the fact that I use a
Japanese environment (and thus I was able to see what it really was on my
display).

The offending character isn't a space (0x20); it is an ISO 8859 no-break
space (0xa0).  As it has the 0x80 bit set, it is not permitted in a quoted
string; only 7-bit characters are permitted in atoms or quoted strings.
That is your IMAP syntax error.

In addition, neither a space nor any 8-bit character can be part of a DNS
name.  If that character was a real space, e.g.
        From: Fred Flintstone <[EMAIL PROTECTED] >
then you either have a no-parse condition or parse it according to the old
RFC 822 rules which permitted such spaces; that is,
        From: Fred Flintstone <[EMAIL PROTECTED]>
and
        From: Fred Flintstone < fred @ bedrock.com >
are equivalent.

The reason why RFC 2822 now prohibits such spaces was that RFC 822 also
permitted such things as:
        From: Fred Flintstone < fred @ bedrock (not slate) . (not org) com >
which were widely acknowledged as bogus.

A reasonable modern implementation is to disregard any spaces around the
<> pair or the @ in the name of compatibility with the past.  Nobody
rationally argued that it worked to imbed spaces in DNS names.

Of course, since the problem in that message is a bogus 8-bit character,
you have a no-parse condition.  How you handle it is up to you, but you
can't put it into a quoted string in an envelope address and expect it to
work.  You could get around IMAP's syntax rule by using a literal, but
then you'd violate the rule about no 8-bit data without a charset tag
which essentially precludes 8-bit in ENVELOPE and BODYSTRUCTURE.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to