School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,090 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,047 people online right now. Registration is fast and FREE... Join Now!




IMAP4 issue

 

IMAP4 issue

ali_selaidin

26 Oct, 2009 - 05:17 AM
Post #1

New D.I.C Head
*

Joined: 24 Mar, 2009
Posts: 25

How to determine the end of an IMAP4 message? Sure, i know i have to check for the tag followed by the OK/BAD word, but i really don't know how to do that, i mean if i have "a100 OK success" which indicates the end of the message can i just check whether the received message contains "a100 OK"...well i can't ofcourse because some other part of the message can contain "a100 OK". Also i can't use the RFC822.SIZE because the size is not correct, the RFC822.SIZE shows the size of the RFC822 message, not the size of the whole message sent by the server. Then how to know whether i have reached the end??? In POP3 you just have to check whether a line contains "." and if "." is the only character on the line.

User is offlineProfile CardPM
+Quote Post


JackOfAllTrades

RE: IMAP4 Issue

10 Nov, 2009 - 02:21 PM
Post #2

I exist to Google your problems.
Group Icon

Joined: 23 Aug, 2008
Posts: 5,319



Thanked: 454 times
Dream Kudos: 50
Expert In: Being annoyed with lazy people.

My Contributions
I am way late on this. For a fetch, the penultimate line will end with a ) and a \r\n pair.
The last line of the message will contain only the tag (a100 in your example), OK, BAD or NO, and a string terminated by a \r\n pair

CODE
...)\r\n
a100 OK Completed\r\n
a100 BAD Failed\r\n
a100 NO Login failed\r\n


From the RFC:
QUOTE
The server completion result response indicates the success or
failure of the operation. It is tagged with the same tag as the
client command which began the operation. Thus, if more than one
command is in progress, the tag in a server completion response
identifies the command to which the response applies. There are
three possible server completion responses: OK (indicating success),
NO (indicating failure), or BAD (indicating a protocol error such as
unrecognized command or command syntax error).

User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic

Time is now: 11/21/09 11:24AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month