Re: [Imap-protocol] significance of leading whitespace in RFC 2822 unstructured headers

Joe Pallas <[email protected]>
Newsgroups gmane.mail.imap.general
Message-ID <[email protected]>
On Oct 29, 2012, at 8:07 PM, Bill Shannon wrote:

> One of the reasons I asked here is because of the interaction between
> the syntax of these header fields and what an IMAP server should do
> when parsing the header and returning the parsed value.

I would say that you are probably right that servers are not actually obeying the spec but it’s hard to see that it matters.  If I ask an IMAP server to fetch “BODY[HEADER.FIELDS (Subject)]” I don’t get back a parsed value, I get back the entire subject line, including any white space between the colon and the first non-WS character.

The two occasions I can think of where skipping white space in an unstructured header might matter are:
1) ENVELOPE, which contains the subject string, and
2) SEARCH of the subject string

It appears that many servers will elide leading spaces from the subject in the returned ENVELOPE structure.  It also appears that some servers will ignore leading spaces in search strings.  At least one server does the former but not the latter.

I can’t imagine relying on the server’s parsing for something like a digital signature.  Unless the server is actually modifying the message headers returned by a non-ENVELOPE fetch, though, I don’t think this should be a concern.

joe

_______________________________________________
Imap-protocol mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-protocol
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.