1

I'm now developing a simple IMAP-client. To recieve message body I'm using command "UID FETCH message-UID BODY.PEEK[]". The question is can I be sure that one of the server responses on the command will be "* message-sequence-number FETCH (UID message-UID BODY[] message-body)"? Or should I be ready to recieve any possible FETCH response (like with message envelope)? I know that I can recieve message flag updates in form of "* message-sequence-number FETCH (FLAGS flags)", I just ignore it now.

Of cause, I've read the standard rfc3501, but did not find out the answer.

Community
  • 1
  • 1
Anton Todua
  • 667
  • 4
  • 15

1 Answers1

2

You can't be sure that the message exists. But if it does exist, then the server has to send you a FETCH that includes both UID and BODY[], usually but not necessarily in that order. In practice it may also include FLAGS but nothing else.

arnt
  • 8,949
  • 5
  • 24
  • 32
  • could you tell me the part of standard which describes it? – Anton Todua May 30 '17 at 11:29
  • 1
    The bottom half of page 54. It's a bit on the terse side, if you ask me, though. The RFC doesn't say "cannot return other stuff", but compatibility with a thousand fragile clients demands that ;) – arnt May 30 '17 at 14:15