Re: [Imap-protocol] Zimbra and FETCH response
Joshua Cranmer <[email protected]> Fri, 30 Jan 2015 17:25:54 -0600
| Newsgroups | gmane.mail.imap.general |
|---|---|
| Message-ID | <[email protected]> |
On 1/30/2015 4:52 PM, Rick Sanders wrote:
> What am I missing or doing wrong?
Your IMAP parser is buggy. The result of a FLAGS is, in the ABNF
terminology:
msg-att = "(" (msg-att-dynamic / msg-att-static)
*(SP (msg-att-dynamic / msg-att-static)) ")"
which is to say, that it is a list of terms in parentheses where each
term is separated by *exactly* one ASCII space (=0x20) character. Where
you're likely screwing up is you're misreading the literal string for
the BODY data. This is a number of octets surrounded by curly braces,
followed by a single CRLF pair, and then the exact number of octets. If
you're searching for a line that consists of particular data... you're
doing something REALLY wrong. Here, let me screw up that match for you
right now:
)
(IMAP isn't like POP, SMTP, or NNTP--multiline data is counted in terms
of exact octets, not until a CRLF.CRLF is found).
--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
_______________________________________________
Imap-protocol mailing list
[email protected]
http://mailman13.u.washington.edu/mailman/listinfo/imap-protocol