Subject: [imapext] REQUESTING FOR SUPPORT TO IMPLEMENT IMAP FETCH COMMAND

From: sayantan pal <[email-masked]>
Date: Wed, 13 Jun 2018 17:59:35 +0530

Dear Team,

    I am implementing my own mail server and thereby developing IMAP
service by own following RFC3501 and 1705. I am unable to implement the
IMAP fetch header and body command. I am using Outlook 2007 as email
client. I have the log file for reference. I thereby requesting for your
kind support to successfully fetch the header and body of a mail.

Thanking You,
Sayantan Pal

---

From: "Chris Newman" <[email-masked]>
Date: Wed, 13 Jun 2018 11:19:30 -0700

Implementing a mail server is probably much harder than you think it is. 
Good luck!

I recommend using an IMAP client that provides good diagnostics for 
testing. Some programming languages, such as Python, include a limited 
IMAP client library you can use for simple testing.

		- Chris

On 13 Jun 2018, at 5:29, sayantan pal wrote:

> _______________________________________________
> imapext mailing list
> [email-masked]

---

From: Bill Shannon <[email-masked]>
Date: Wed, 13 Jun 2018 11:28:22 -0700

JavaMail [1] includes pretty complete IMAP support, and the debugging output [2]
might help you determine what's wrong.

[1] https://javaee.github.io/javamail/
[2] https://javaee.github.io/javamail/FAQ#debug

Chris Newman wrote on 06/13/18 11:19 AM:
> Implementing a mail server is probably much harder than you think it is. Good luck!
> 
> I recommend using an IMAP client that provides good diagnostics for testing.
> Some programming languages, such as Python, include a limited IMAP client
> library you can use for simple testing.
> 
>         - Chris
> 
> https://www.ietf.org/mailman/listinfo/imapext

---

From: "Chris Newman" <[email-masked]>
Date: Thu, 14 Jun 2018 06:10:13 -0700

You may need to read the formal ABNF for RFC 5322 and RFC 3501 more 
carefully. The previous advice you received about test clients may also 
be helpful. This is a list to discuss the standards and their 
extensions, not to help debug your implementation.

		- Chris

On 13 Jun 2018, at 21:34, sayantan pal wrote:

> Dear Chris,
>
>         This is being a client server conversation:
>
> client: xx UID FETCH 2:8 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])
> server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] 
> {4348}
> X-Recent: Recent
> Received: by mail-lf0-f48.google.com with SMTP id 
> n15-v6so29788633lfn.10
> for <[email-masked]>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)
> MIME-Version: 1.0
> From: sayantan pal <[email-masked]>
> Date: Mon, 11 Jun 2018 16:17:04 +0530
> Message-ID: <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=
> [email-masked]>
> Subject: 2
> To: A <[email-masked]>
> Content-Type: multipart/alternative; 
> boundary="0000000000006f01d7056e5b788f"
>
>
> )
>
> This reply is somehow wrong w.r.t a server reply and I am getting 
> parse
> error from Outlook. I am attaching a .msg file which my server 
> received by
> the smtp service I have developed. Please check. I have not written 
> all the
> headers in this mail. I am retrieving all the header using mailbee
> extension. It has a property named RawHeaders which retrieves all the
> headers.
>
> Thank You,
> Sayantan Pal
>
> On Wed, Jun 13, 2018 at 11:49 PM, Chris Newman 
> <[email-masked]>
> wrote:
>
>> testing. Some programming languages, such as Python, include a 
>> limited IMAP
>> client library you can use for simple testing.
>>
>>                 - Chris
>>
>>

---

From: sayantan pal <[email-masked]>
Date: Thu, 14 Jun 2018 09:51:42 +0530

Dear Chris,

     I appriciate your suggestions. I developed a smtp and pop3 services
using C#. They are working good. Now I stepped for IMAP. I successfuly
implemented capa, auth, login, list and lsub command. I am using Microsoft
Outlook 2007 as client. Now I received two commands
xx UID FETCH 2:8 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])

yy UID FETCH 8 (UID FLAGS RFC822.SIZE BODY.PEEK[])

For the header command I am sending the entire message header and for body
command I am sending the entire message as string but I am getting a parse
error problem. My question is what is the exact string format which will
match the RFC standard. I couldn't find any example in RFC3501 and 1705. I
am using c# and writing my own library following RFC logics. Please find
the outlook log file.

---

From: sayantan pal <[email-masked]>
Date: Thu, 14 Jun 2018 10:04:18 +0530

Dear Chris,

client: xx UID FETCH 2:8 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])
server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] {4348}
X-Recent: Recent
Received: by mail-lf0-f48.google.com with SMTP id n15-v6so29788633lfn.10
for <[email-masked]>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)
MIME-Version: 1.0
From: sayantan pal <[email-masked]>
Date: Mon, 11 Jun 2018 16:17:04 +0530
Message-ID: <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=
[email-masked]>
Subject: 2
To: A <[email-masked]>
Content-Type: multipart/alternative; boundary="0000000000006f01d7056e5b788f"

)

This reply is somehow wrong w.r.t a server reply and I am getting parse
error from Outlook. I am attaching a .msg file which my server received by
the smtp service I have developed. Please check. I have not written all the
headers in this mail. I am retrieving all the header using mailbee
extension. It has a property named RawHeaders which retrieves all the
headers.

Thank You,
Sayantan Pal

On Wed, Jun 13, 2018 at 11:49 PM, Chris Newman <[email-masked]>
wrote:

> testing. Some programming languages, such as Python, include a limited IMAP