MBOX-Line: From mrc at CAC.Washington.EDU  Mon Jun 20 11:28:57 2005
To: imap-protocol@u.washington.edu
From: Mark Crispin <mrc@CAC.Washington.EDU>
Date: Fri Jun  8 12:34:36 2018
Subject: [Imap-protocol] handling of bad addresses
In-Reply-To: <42B703D9.5060803@sun.com>
References: <42B703D9.5060803@sun.com>
Message-ID: <Pine.OSX.4.63.0506201122210.16188@pangtzu.panda.com>

On Mon, 20 Jun 2005, Bill Shannon wrote:
> It's always been my understanding that an IMAP server is required to
> return valid ENVELOPE information even if the message it's processing
> fails to meet RFC822 requirements.

This is correct.  However, the principle of GIGO (garbage in, garbage out) 
applies; as long as the IMAP protocol that you generate is valid you 
aren't required to handle bogus incoming RFC 2822 data in any particular 
way.

> What may an IMAP server do with a message that includes a header of
> the form:
> From: SPAMIS:

I would return a two-address list, one with the start of group and the 
other with an end of group.

> Is the IMAP server allowed to return an address list that includes a
> "start of group" element but no "end of group" element?
> Must an IMAP client be prepared for unmatched start/end group elements?

The IMAP specification is silent on this point; but I would recommend that 
the IMAP server supply the missing end of group.  Otherwise, an RFC 2822 
generator using the IMAP address list as a source will re-generate the 
invalid RFC 2822 address list.

Note that a group without an end of group indicator commonly appears in 
messages in the 1970s (as do messages which use " at " instead of "@"). 
So, it's reasonable to recognize such things and represent them in the 
modern form.

-- Mark --

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

