Fetch command response in IMAP in Mail server

Sayantan Pal

New Email
What should be the response format from a mail server for the below IMAP command fired from client [Microsoft Outlook 2007]
Microsoft Outlook: hmo8 UID FETCH 1:2 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])
I tried many response but getting PARSE ERROR: hr=2148322516 & PARSE ERROR: hr=2148322522
1.Response 1:

"* 1 FETCH (UID 1 FLAGS (\SEEN) RFC822.SIZE 4812 BODY[HEADER] {476}"
"From: x@ymail.com"
"To: y@xmail.com"
"Date: 00/00/0000 0:00:00 AM"
"Content-Type: multipart/alternative"
"Message-ID: "
")"

2.Response 2:

"* 1 FETCH (UID 1 FLAGS (\SEEN) RFC822.SIZE 4812 BODY[HEADER] {476}"
"* From: x@ymail.com"
"* To: y@xmail.com"
"* Subject: kkk"
"* Date: 00/00/0000 0:00:00 AM"
"* Content-Type: multipart/alternative"
"* Message-ID: "
"* )"

3.Response 3:

"* 1 FETCH (UID 1 FLAGS (\SEEN) RFC822.SIZE 4812 BODY[HEADER] {476}"
"hmo8 OK From: x@ymail.com"
"hmo8 OK To: y@xmail.com"
"hmo8 OK Subject: kkk"
"hmo8 OK Date: 00/00/0000 0:00:00 AM"
"hmo8 OK Content-Type: multipart/alternative"
"hmo8 OK Message-ID: " "hmo8 OK )"

4.Response 4:

"* 1 FETCH (UID 1 FLAGS (\SEEN) RFC822.SIZE 4812 BODY[HEADER] {476}"
" From: x@ymail.com"// From starts after tab spaces
" To: y@xmail.com"// To starts after tab spaces
" Subject: kkk"// Subject starts after tab spaces
" Date: 00/00/0000 0:00:00 AM"// Date starts after tab spaces
" Content-Type: multipart/alternative"// Content starts after tab spaces
" Message-ID: "// ID starts after tab spaces
"* )"

Please let me know what will be the exact reply format; Besides I calculated the Header size individually and added them up. I followed RFC 3501 7.4.2
 
Top