MBOX-Line: From norman at apache.org  Fri Apr 15 02:34:43 2011
To: imap-protocol@u.washington.edu
From: Norman Maurer <norman@apache.org>
Date: Fri Jun  8 12:34:45 2018
Subject: [Imap-protocol] FETCH Response
Message-ID: <BANLkTi=fFBXLWaJ9bnnjm2dO0uYJPGGnkQ@mail.gmail.com>

Hi there,

while reading the rfc3501 and think about FETCH Response one question
come in my mind. The rfc says:

BODY[<section>]<<partial>>
...
...
         The HEADER, HEADER.FIELDS, and HEADER.FIELDS.NOT part
         specifiers refer to the [RFC-2822] header of the message or of
         an encapsulated [MIME-IMT] MESSAGE/RFC822 message.
         HEADER.FIELDS and HEADER.FIELDS.NOT are followed by a list of
         field-name (as defined in [RFC-2822]) names, and return a

         subset of the header.  The subset returned by HEADER.FIELDS
         contains only those header fields with a field-name that
         matches one of the names in the list; similarly, the subset
         returned by HEADER.FIELDS.NOT contains only the header fields
         with a non-matching field-name.  The field-matching is
         case-insensitive but otherwise exact.  Subsetting does not
         exclude the [RFC-2822] delimiting blank line between the header
         and the body; the blank line is included in all header fetches,
         except in the case of a message which has no body and no blank
         line.

So if I have a multipart message which has a body but no "BODY TEXT"
should the single newline get written when ask for headers nor not ?

C: A16 FETCH 1 (BODY[3])
S: \* 1 FETCH \(BODY\[3\] \{1124\}
S: PGh0bWw\+PGhlYWQ\+PHRpdGxlPjwvdGl0bGU\+PC9oZWFkPgo8Ym9keT4KPGJsb2NrcXVvdGUgY2l0
S: ZT0naHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9XaWxsaWFtX1NoYWtlc3BlYXJlJz48cHJl
S: PgpUaG9zZSBwYXJ0cyBvZiB0aGVlIHRoYXQgdGhlIHdvcmxkJ3MgZXllIGRvdGggdmlldwpXYW50
S: IG5vdGhpbmcgdGhhdCB0aGUgdGhvdWdodCBvZiBoZWFydHMgY2FuIG1lbmQ7CkFsbCB0b25ndWVz
S: LS10aGUgdm9pY2Ugb2Ygc291bHMtLWdpdmUgdGhlZSB0aGF0IGR1ZSwKVXR0ZXJpbmcgYmFyZSB0
S: cnV0aCwgZXZlbiBzbyBhcyBmb2VzIGNvbW1lbmQuClRoeSBvdXR3YXJkIHRodXMgd2l0aCBvdXR3
S: YXJkIHByYWlzZSBpcyBjcm93bidkOwpCdXQgdGhvc2Ugc2FtZSB0b25ndWVzLCB0aGF0IGdpdmUg
S: dGhlZSBzbyB0aGluZSBvd24sCkluIG90aGVyIGFjY2VudHMgZG8gdGhpcyBwcmFpc2UgY29uZm91
S: bmQKQnkgc2VlaW5nIGZhcnRoZXIgdGhhbiB0aGUgZXllIGhhdGggc2hvd24uClRoZXkgbG9vayBp
S: bnRvIHRoZSBiZWF1dHkgb2YgdGh5IG1pbmQsCkFuZCB0aGF0IGluIGd1ZXNzIHRoZXkgbWVhc3Vy
S: ZSBieSB0aHkgZGVlZHM7ClRoZW4tLWNodXJscy0tdGhlaXIgdGhvdWdodHMsIGFsdGhvdWdoIHRo
S: ZWlyIGV5ZXMgd2VyZSBraW5kLApUbyB0aHkgZmFpciBmbG93ZXIgYWRkIHRoZSByYW5rIHNtZWxs
S: IG9mIHdlZWRzOiAKICBCdXQgd2h5IHRoeSBvZG91ciBtYXRjaGV0aCBub3QgdGh5IHNob3csCiAg
S: VGhlIHNvaWwgaXMgdGhpcywgdGhhdCB0aG91IGRvc3QgY29tbW9uIGdyb3cuCjwvcHJlPjwvYmxv
S: Y2txdW90ZT4KPC9ib2R5PjwvaHRtbD4K\)
S: A16 OK FETCH completed\.
C: A18 FETCH 1 (BODY[3.TEXT])
S: \* 1 FETCH \(BODY\[3\.TEXT\] \{0\}
S: \)
S: A17 OK FETCH completed\.
C: A17 FETCH 1 (BODY[3.HEADER])
S: \* 1 FETCH \(BODY\[3\.HEADER\] \{0\}
S: \)
S: A17 OK FETCH completed\.

Or should it be:

C: A17 FETCH 1 (BODY[3.HEADER])
S: \* 1 FETCH \(BODY\[3\.HEADER\] \{2\}
S:
S: \)

Thanks,
Norman

