
From nobody Sun Jul  1 23:45:35 2018
Return-Path: <barryleiba.mailing.lists@gmail.com>
X-Original-To: imapext@ietfa.amsl.com
Delivered-To: imapext@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5DFE1130E17 for <imapext@ietfa.amsl.com>; Sun,  1 Jul 2018 23:45:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.399
X-Spam-Level: 
X-Spam-Status: No, score=-1.399 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yk-cT7emfg3k for <imapext@ietfa.amsl.com>; Sun,  1 Jul 2018 23:45:31 -0700 (PDT)
Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 55E83130DF4 for <imapext@ietf.org>; Sun,  1 Jul 2018 23:45:31 -0700 (PDT)
Received: by mail-qt0-x233.google.com with SMTP id y31-v6so12976834qty.9 for <imapext@ietf.org>; Sun, 01 Jul 2018 23:45:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SH35iWsU6zLR2Jq3DTRM5qpKI2xxQrIpiOrR9EfQO/Y=; b=eVoWSFRucqU7nVNd8KHk5/wzbf8iOz8AzmOPkxg3z7igS8uCyOB4PbF6KyHg91ojqT Yk0dxf3tIumjJhIZv2eocAE7Que+JuyYjZpKJJvz8ufCgszUEIDums5gGJYYRLAlaAtZ tTSeN6lXPbYpWEaysgOkJ33zX1MoqqqJjY/YMHYDwkkDVX9eckI8TFROlOUHFn+DBLCC Itw2n/E4HpDPM4ReFkuY8g+pAnm7Kdx+N/jSYmiWubVDu20piIxlBzMBfI4nMMoQolSU Gg8GuaiAD14sVTDSdN8yapTiuf2gtG9Xhpl/J/1u2LfgU3sdrafFuA0KDYKopzY5xId5 nLnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=SH35iWsU6zLR2Jq3DTRM5qpKI2xxQrIpiOrR9EfQO/Y=; b=Bcri/v3oXnuLrkmONZjvLEy/etEN6eAKf1q2TJy4lplbZUPK3E8BTucMwoNocl95Q/ 4gspo1BFgJQkqX0aetH3YoZD85S+yTqrj6xsnKiNReufyS8/4vD+0x5Sbt3gZ8xNqun4 eC4S4FvOxMfuEVSb9HC9uXwZneRgqEAb+rpT1u8kb+57ccYvMTfK9xlSTZWqEIASDJxM DGAKqLc66Y++roVucAeWIsZ8F92yxH87yWNfLJRhb9H0w6WCVkvVJ+/wtQ0sxZgB2ai6 pnUV0MGlaWIj1VJVsQqfLfzYaqDcfwC/1c2+gpqIzZbCFd1sqV1+ozv+e6Hiy8IgKQba s1FA==
X-Gm-Message-State: APt69E2dm2yF+YLKbxLlPJY2VqsRODVZpn2v6yLCyw/zVcGQ1BUBxqSM PlsY05cfkj/5aQMGTWu0r1NTIIb2ArK4WrDYzzQ=
X-Google-Smtp-Source: AAOMgpeKLUtowjotcrQKLng+PXCk01Bikqmdx1FAnq4tIK440X27KvGkwZBlxGklMKP+l+P+P2bcd1fwphiv5h88uiA=
X-Received: by 2002:aed:3e82:: with SMTP id n2-v6mr22314334qtf.359.1530513930406;  Sun, 01 Jul 2018 23:45:30 -0700 (PDT)
MIME-Version: 1.0
Sender: barryleiba.mailing.lists@gmail.com
Received: by 2002:ac8:70cd:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 23:45:29 -0700 (PDT)
In-Reply-To: <CACsjV1z3GVT7vAYDLs1SMU_VXtaZvYBpLv-RSDj3UxrLrL879A@mail.gmail.com>
References: <CACsjV1zdMJkgsUFrdB8tUbkLw-_N0JzVxd5zQUErV_LhxT_R_Q@mail.gmail.com> <3358ED02-9B0E-419D-9BD2-EA9FD459D7B6@oracle.com> <CACsjV1z3GVT7vAYDLs1SMU_VXtaZvYBpLv-RSDj3UxrLrL879A@mail.gmail.com>
From: Barry Leiba <barryleiba@computer.org>
Date: Mon, 2 Jul 2018 02:45:29 -0400
X-Google-Sender-Auth: W6mk9q4sNen3K2ZwMun9W8ZbRLM
Message-ID: <CAC4RtVBXnR0KQXTD8raqS2iYjDCyLiOxwwpPG5JWm+aMmt1R=w@mail.gmail.com>
To: sayantan pal <sayantan.pal19@gmail.com>
Cc: Chris Newman <chris.newman@oracle.com>, imapext@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/imapext/Ox0P8Rauen0ni18ecgE2WDNqQME>
Subject: Re: [imapext] REQUESTING FOR SUPPORT TO IMPLEMENT IMAP FETCH COMMAND
X-BeenThere: imapext@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: Discussion of IMAP extensions <imapext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/imapext>, <mailto:imapext-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/imapext/>
List-Post: <mailto:imapext@ietf.org>
List-Help: <mailto:imapext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/imapext>, <mailto:imapext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Jul 2018 06:45:34 -0000

As Chris said, we're not here to help you debug your implementation.
But I'll give you some hints for free, after a quick check of what you
sent:

> server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] {4348}

A quick eyeball of the .msg file that you included shows that both
your RFC822.SIZE and body header literal length value appear to be way
off.  The correct body header size looks like it's a little more than
2700 bytes.

The only reason I'm spending a little time on this is to note that
literals are hard for many people to grasp, and lots of implementers
are confused by them at first.

For example, the first line of the message, <<X-Recent: Recent>>
contributes 18 bytes to the BODY[HEADER] literal -- one byte each for
each of the 16 characters there, plus one for the CR and one for the
LF that follow the string.  The next header field (the "Received"
header) adds another 72 + 2 + 69 + 2 -- 72 bytes for the first line, a
CRLF, 69 bytes for the second line, and a CRLF.  Repeat this through
the whole header, then add another final CRLF.  The literal length
count has to match that total *exactly*.

The other thing to realize is that as soon as there's a parsing
problem, it's likely to cascade and turn into an infinite number of
parsing problems because the client and server are completely out of
sync.

Another hint: It would help you a great deal to have protocol logging
in your client, in addition to relying on the server logging.  If you
have a clear record of what you sent and how you got there, it could
show errors more clearly, especially once Outlook becomes confused by
what you sent it.

Barry

On Thu, Jun 14, 2018 at 12:34 AM, sayantan pal <sayantan.pal19@gmail.com> 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 <A@cogitomail.com>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)
> MIME-Version: 1.0
> From: sayantan pal <sayantan.pal19@gmail.com>
> Date: Mon, 11 Jun 2018 16:17:04 +0530
> Message-ID:
> <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=zG0L13TXeQA@mail.gmail.com>
> Subject: 2
> To: A <A@cogitomail.com>
> 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 <chris.newman@oracle.com>
> wrote:
>>
>> 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:
>>
>>>  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
>>> _______________________________________________
>>> imapext mailing list
>>> imapext@ietf.org
>
>
>
> _______________________________________________
> imapext mailing list
> imapext@ietf.org
> https://www.ietf.org/mailman/listinfo/imapext
>


From nobody Mon Jul  2 09:42:44 2018
Return-Path: <sayantan.pal19@gmail.com>
X-Original-To: imapext@ietfa.amsl.com
Delivered-To: imapext@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 40122130E17 for <imapext@ietfa.amsl.com>; Sun,  1 Jul 2018 23:49:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.748
X-Spam-Level: 
X-Spam-Status: No, score=-1.748 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04z-3G6gpsyG for <imapext@ietfa.amsl.com>; Sun,  1 Jul 2018 23:49:39 -0700 (PDT)
Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 826D6130DF4 for <imapext@ietf.org>; Sun,  1 Jul 2018 23:49:38 -0700 (PDT)
Received: by mail-lf0-x243.google.com with SMTP id n96-v6so11121647lfi.1 for <imapext@ietf.org>; Sun, 01 Jul 2018 23:49:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VD0FjvNa5ysoAYdM779+qzyCzn8dScc2uWBzBa02mRU=; b=IDQqcgmBB11qIMkzg0tsRjE4SYLFbI/00lJM/cZQLyvS9NlY+XyS0ihAajMjugMHD+ vwzK+q2sXl9UttKUv7Q/2ZqEmTTuCx8B6naEk6b+vIK49RCF+ihb9jvlp2DEwwGDWWam Z4LsEx1VQKstN7nwZlPEh7Jqz587/PFluyTZfrIeoV7cZrnHhFvuxrVs14YNvIixsbZi mqcd5Sq7wkADuV/+E/KZS0EHnSh88w5+uT7Bmx5JmgPcWzuEc4DDaJN6KY05vfgpBL8A S6sV7r7COGWf/oR5jsXMSYtxAqjtvHoFUxtZn0xq8ctKS1HJoNIeuZ9VrVggO5NyoviD cenA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VD0FjvNa5ysoAYdM779+qzyCzn8dScc2uWBzBa02mRU=; b=GC7MhuxOl0N05PnXkN/TbWzt5VF/0gylLYPxmIn3WzWNyOOadp1yYuDYBKrZ4QfDSX iILyReZcjKJ1vce44BJQcFes9YN1ZTI68uJdCDq3VwZfOLS7W0+h+Wh9Toa1xY6w4dkm ZfQ0aiGr014Wq1+SSOa5bpav+TBRjveQ2YmF60OoT7LLtzc4K5g1Un85OEQawvWzU8CJ rEntyiaufNsNFJz6gFdH1yBqz2ldvaaywcuVnjdFHzczWlWBrOy00J+aDC1H17WaVK1k oDxYZN9U/c3ADSMcy/KBeNCMRv0aT65gaIKEU8qMBGi5sDtMmuvAsC7O9w9VAn5kTNJ/ jMwQ==
X-Gm-Message-State: APt69E34xK83gbWNbmYD6kT4AWaHU3YI/cfE4A6Px2YkQLdhJgW/ntZS Luqmwp/5p/unjzkK+LEVnrjc8cQAci9mO3caySQ=
X-Google-Smtp-Source: AAOMgpeYL8e6B3JsmeRQR1rNEtqvvmsc4U2Nhkkn17Lzu6qwqM2L6adfLLQtYi+REwPPWRja/Wi9z3zCykjql/sBLhc=
X-Received: by 2002:a19:e803:: with SMTP id f3-v6mr15162289lfh.84.1530514176686;  Sun, 01 Jul 2018 23:49:36 -0700 (PDT)
MIME-Version: 1.0
References: <CACsjV1zdMJkgsUFrdB8tUbkLw-_N0JzVxd5zQUErV_LhxT_R_Q@mail.gmail.com> <3358ED02-9B0E-419D-9BD2-EA9FD459D7B6@oracle.com> <CACsjV1z3GVT7vAYDLs1SMU_VXtaZvYBpLv-RSDj3UxrLrL879A@mail.gmail.com> <CAC4RtVBXnR0KQXTD8raqS2iYjDCyLiOxwwpPG5JWm+aMmt1R=w@mail.gmail.com>
In-Reply-To: <CAC4RtVBXnR0KQXTD8raqS2iYjDCyLiOxwwpPG5JWm+aMmt1R=w@mail.gmail.com>
From: sayantan pal <sayantan.pal19@gmail.com>
Date: Mon, 2 Jul 2018 12:23:48 +0530
Message-ID: <CACsjV1ydxn1Vo0hEs=uMHDO7aZQ7Gqq7J+G4-xJJzyentvm0_w@mail.gmail.com>
To: barryleiba@computer.org
Cc: Chris Newman <chris.newman@oracle.com>, imapext@ietf.org
Content-Type: multipart/alternative; boundary="000000000000d33cc0056ffe99a8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/imapext/ICIoaGz8Ob_ujcVZX2aLzKiCdo8>
X-Mailman-Approved-At: Mon, 02 Jul 2018 09:42:43 -0700
Subject: Re: [imapext] REQUESTING FOR SUPPORT TO IMPLEMENT IMAP FETCH COMMAND
X-BeenThere: imapext@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: Discussion of IMAP extensions <imapext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/imapext>, <mailto:imapext-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/imapext/>
List-Post: <mailto:imapext@ietf.org>
List-Help: <mailto:imapext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/imapext>, <mailto:imapext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Jul 2018 06:49:42 -0000

--000000000000d33cc0056ffe99a8
Content-Type: text/plain; charset="UTF-8"

Dear Barry Leiba,

    Thank You so much for your highness. You are absolutely correct. The
problem was in header size. I solved this issue. Previously I coded to
calculate the header byte count. Later I found it is actually calculating
the character length. This problem has been solved. The present problem is
in folder synchronisation. I am working on that. If you allow me I can
share the problem.

Thank You,
Sayantan Pal

On Mon, Jul 2, 2018 at 12:15 PM Barry Leiba <barryleiba@computer.org> wrote:

> As Chris said, we're not here to help you debug your implementation.
> But I'll give you some hints for free, after a quick check of what you
> sent:
>
> > server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER]
> {4348}
>
> A quick eyeball of the .msg file that you included shows that both
> your RFC822.SIZE and body header literal length value appear to be way
> off.  The correct body header size looks like it's a little more than
> 2700 bytes.
>
> The only reason I'm spending a little time on this is to note that
> literals are hard for many people to grasp, and lots of implementers
> are confused by them at first.
>
> For example, the first line of the message, <<X-Recent: Recent>>
> contributes 18 bytes to the BODY[HEADER] literal -- one byte each for
> each of the 16 characters there, plus one for the CR and one for the
> LF that follow the string.  The next header field (the "Received"
> header) adds another 72 + 2 + 69 + 2 -- 72 bytes for the first line, a
> CRLF, 69 bytes for the second line, and a CRLF.  Repeat this through
> the whole header, then add another final CRLF.  The literal length
> count has to match that total *exactly*.
>
> The other thing to realize is that as soon as there's a parsing
> problem, it's likely to cascade and turn into an infinite number of
> parsing problems because the client and server are completely out of
> sync.
>
> Another hint: It would help you a great deal to have protocol logging
> in your client, in addition to relying on the server logging.  If you
> have a clear record of what you sent and how you got there, it could
> show errors more clearly, especially once Outlook becomes confused by
> what you sent it.
>
> Barry
>
> On Thu, Jun 14, 2018 at 12:34 AM, sayantan pal <sayantan.pal19@gmail.com>
> 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 <A@cogitomail.com>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)
> > MIME-Version: 1.0
> > From: sayantan pal <sayantan.pal19@gmail.com>
> > Date: Mon, 11 Jun 2018 16:17:04 +0530
> > Message-ID:
> > <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=zG0L13TXeQA@mail.gmail.com>
> > Subject: 2
> > To: A <A@cogitomail.com>
> > 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 <chris.newman@oracle.com>
> > wrote:
> >>
> >> 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:
> >>
> >>>  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
> >>> _______________________________________________
> >>> imapext mailing list
> >>> imapext@ietf.org
> >
> >
> >
> > _______________________________________________
> > imapext mailing list
> > imapext@ietf.org
> > https://www.ietf.org/mailman/listinfo/imapext
> >
>

--000000000000d33cc0056ffe99a8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Dear Barry Leiba,<br><div><br></div><div>=C2=A0 =C2=A0 Tha=
nk You so much for your highness. You are absolutely correct. The problem w=
as in header size. I solved this issue. Previously I coded to calculate the=
 header byte count. Later I found it is actually calculating the character =
length. This problem has been solved. The present problem is in folder sync=
hronisation. I am working on that. If you allow me I can share the problem.=
</div><div><br></div><div>Thank You,</div><div>Sayantan Pal=C2=A0</div></di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Jul 2, 2018 at 12=
:15 PM Barry Leiba &lt;<a href=3D"mailto:barryleiba@computer.org">barryleib=
a@computer.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As Ch=
ris said, we&#39;re not here to help you debug your implementation.<br>
But I&#39;ll give you some hints for free, after a quick check of what you<=
br>
sent:<br>
<br>
&gt; server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] {=
4348}<br>
<br>
A quick eyeball of the .msg file that you included shows that both<br>
your RFC822.SIZE and body header literal length value appear to be way<br>
off.=C2=A0 The correct body header size looks like it&#39;s a little more t=
han<br>
2700 bytes.<br>
<br>
The only reason I&#39;m spending a little time on this is to note that<br>
literals are hard for many people to grasp, and lots of implementers<br>
are confused by them at first.<br>
<br>
For example, the first line of the message, &lt;&lt;X-Recent: Recent&gt;&gt=
;<br>
contributes 18 bytes to the BODY[HEADER] literal -- one byte each for<br>
each of the 16 characters there, plus one for the CR and one for the<br>
LF that follow the string.=C2=A0 The next header field (the &quot;Received&=
quot;<br>
header) adds another 72 + 2 + 69 + 2 -- 72 bytes for the first line, a<br>
CRLF, 69 bytes for the second line, and a CRLF.=C2=A0 Repeat this through<b=
r>
the whole header, then add another final CRLF.=C2=A0 The literal length<br>
count has to match that total *exactly*.<br>
<br>
The other thing to realize is that as soon as there&#39;s a parsing<br>
problem, it&#39;s likely to cascade and turn into an infinite number of<br>
parsing problems because the client and server are completely out of<br>
sync.<br>
<br>
Another hint: It would help you a great deal to have protocol logging<br>
in your client, in addition to relying on the server logging.=C2=A0 If you<=
br>
have a clear record of what you sent and how you got there, it could<br>
show errors more clearly, especially once Outlook becomes confused by<br>
what you sent it.<br>
<br>
Barry<br>
<br>
On Thu, Jun 14, 2018 at 12:34 AM, sayantan pal &lt;<a href=3D"mailto:sayant=
an.pal19@gmail.com" target=3D"_blank">sayantan.pal19@gmail.com</a>&gt; wrot=
e:<br>
&gt; Dear Chris,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0This is being a client server convers=
ation:<br>
&gt;<br>
&gt; client: xx UID FETCH 2:8 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])<br>
&gt; server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] {=
4348}<br>
&gt; X-Recent: Recent<br>
&gt; Received: by <a href=3D"http://mail-lf0-f48.google.com" rel=3D"norefer=
rer" target=3D"_blank">mail-lf0-f48.google.com</a> with SMTP id n15-v6so297=
88633lfn.10<br>
&gt; for &lt;<a href=3D"mailto:A@cogitomail.com" target=3D"_blank">A@cogito=
mail.com</a>&gt;; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)<br>
&gt; MIME-Version: 1.0<br>
&gt; From: sayantan pal &lt;<a href=3D"mailto:sayantan.pal19@gmail.com" tar=
get=3D"_blank">sayantan.pal19@gmail.com</a>&gt;<br>
&gt; Date: Mon, 11 Jun 2018 16:17:04 +0530<br>
&gt; Message-ID:<br>
&gt; &lt;CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=3D<a href=3D"mailto:zG0L13=
TXeQA@mail.gmail.com" target=3D"_blank">zG0L13TXeQA@mail.gmail.com</a>&gt;<=
br>
&gt; Subject: 2<br>
&gt; To: A &lt;<a href=3D"mailto:A@cogitomail.com" target=3D"_blank">A@cogi=
tomail.com</a>&gt;<br>
&gt; Content-Type: multipart/alternative; boundary=3D&quot;0000000000006f01=
d7056e5b788f&quot;<br>
&gt;<br>
&gt;<br>
&gt; )<br>
&gt;<br>
&gt; This reply is somehow wrong w.r.t a server reply and I am getting pars=
e<br>
&gt; error from Outlook. I am attaching a .msg file which my server receive=
d by<br>
&gt; the smtp service I have developed. Please check. I have not written al=
l the<br>
&gt; headers in this mail. I am retrieving all the header using mailbee<br>
&gt; extension. It has a property named RawHeaders which retrieves all the<=
br>
&gt; headers.<br>
&gt;<br>
&gt; Thank You,<br>
&gt; Sayantan Pal<br>
&gt;<br>
&gt; On Wed, Jun 13, 2018 at 11:49 PM, Chris Newman &lt;<a href=3D"mailto:c=
hris.newman@oracle.com" target=3D"_blank">chris.newman@oracle.com</a>&gt;<b=
r>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Implementing a mail server is probably much harder than you think =
it is.<br>
&gt;&gt; Good luck!<br>
&gt;&gt;<br>
&gt;&gt; I recommend using an IMAP client that provides good diagnostics fo=
r<br>
&gt;&gt; testing.. Some programming languages, such as Python, include a li=
mited IMAP<br>
&gt;&gt; client library you can use for simple testing.<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- Chr=
is<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 13 Jun 2018, at 5:29, sayantan pal wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;=C2=A0 Dear Team,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0I am implementing my own mail server and th=
ereby developing IMAP<br>
&gt;&gt;&gt; service by own following RFC3501 and 1705. I am unable to impl=
ement the<br>
&gt;&gt;&gt; IMAP fetch header and body command. I am using Outlook 2007 as=
 email<br>
&gt;&gt;&gt; client. I have the log file for reference. I thereby requestin=
g for your<br>
&gt;&gt;&gt; kind support to successfully fetch the header and body of a ma=
il.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanking You,<br>
&gt;&gt;&gt; Sayantan Pal<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; imapext mailing list<br>
&gt;&gt;&gt; <a href=3D"mailto:imapext@ietf.org" target=3D"_blank">imapext@=
ietf.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; imapext mailing list<br>
&gt; <a href=3D"mailto:imapext@ietf.org" target=3D"_blank">imapext@ietf.org=
</a><br>
&gt; <a href=3D"https://www.ietf.org/mailman/listinfo/imapext" rel=3D"noref=
errer" target=3D"_blank">https://www.ietf.org/mailman/listinfo/imapext</a><=
br>
&gt;<br>
</blockquote></div>

--000000000000d33cc0056ffe99a8--

