37 lines
1.4 KiB
Plaintext
37 lines
1.4 KiB
Plaintext
MBOX-Line: From Pidgeot18 at verizon.net Fri Jan 30 15:25:54 2015
|
|
To: imap-protocol@u.washington.edu
|
|
From: Joshua Cranmer <Pidgeot18@verizon.net>
|
|
Date: Fri Jun 8 12:34:53 2018
|
|
Subject: [Imap-protocol] Zimbra and FETCH response
|
|
In-Reply-To: <54CC0B1A.5040701@earthlink.net>
|
|
References: <54CC0B1A.5040701@earthlink.net>
|
|
Message-ID: <54CC1302.80003@verizon.net>
|
|
|
|
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
|
|
|
|
|