Re: REQUESTING FOR SUPPORT TO IMPLEMENT IMAP FETCH COMMAND
sayantan pal <[email protected]> Mon, 2 Jul 2018 12:23:48 +0530
| Newsgroups | gmane.ietf.imapext |
|---|---|
| Message-ID | <CACsjV1ydxn1Vo0hEs=uMHDO7aZQ7Gqq7J+G4-xJJzyentvm0_w@mail.gmail.com> |
--===============8821406948188556363==
Content-Type: multipart/alternative; boundary="000000000000d33cc0056ffe99a8"
--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 <[email protected]> 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 <[email protected]>
> 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 protected]>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)
> > MIME-Version: 1.0
> > From: sayantan pal <[email protected]>
> > Date: Mon, 11 Jun 2018 16:17:04 +0530
> > Message-ID:
> > <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=zG0L13TXeQA@mail.gmail.com>
> > Subject: 2
> > To: A <[email protected]>
> > 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 protected]>
> > 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
> >>> [email protected]
> >
> >
> >
> > _______________________________________________
> > imapext mailing list
> > [email protected]
> > 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 <<a href=3D"mailto:[email protected]">barryleib=
[email protected]</a>> 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're not here to help you debug your implementation.<br>
But I'll give you some hints for free, after a quick check of what you<=
br>
sent:<br>
<br>
> 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's a little more t=
han<br>
2700 bytes.<br>
<br>
The only reason I'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, <<X-Recent: Recent>>=
;<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 "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's a parsing<br>
problem, it'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 <<a href=3D"mailto:sayant=
[email protected]" target=3D"_blank">[email protected]</a>> wrot=
e:<br>
> Dear Chris,<br>
><br>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0This is being a client server convers=
ation:<br>
><br>
> client: xx UID FETCH 2:8 (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER])<br>
> server: * 1 FETCH (UID 2 FLAGS (\SEEN) RFC822.SIZE 4794 BODY[HEADER] {=
4348}<br>
> X-Recent: Recent<br>
> 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>
> for <<a href=3D"mailto:[email protected]" target=3D"_blank">A@cogito=
mail.com</a>>; Mon, 11 Jun 2018 03:47:22 -0700 (PDT)<br>
> MIME-Version: 1.0<br>
> From: sayantan pal <<a href=3D"mailto:[email protected]" tar=
get=3D"_blank">[email protected]</a>><br>
> Date: Mon, 11 Jun 2018 16:17:04 +0530<br>
> Message-ID:<br>
> <CACsjV1wAbBpE2dJ_xzB6qUf2O2nsXsqqGuufLd=3D<a href=3D"mailto:zG0L13=
[email protected]" target=3D"_blank">[email protected]</a>><=
br>
> Subject: 2<br>
> To: A <<a href=3D"mailto:[email protected]" target=3D"_blank">A@cogi=
tomail.com</a>><br>
> Content-Type: multipart/alternative; boundary=3D"0000000000006f01=
d7056e5b788f"<br>
><br>
><br>
> )<br>
><br>
> This reply is somehow wrong w.r.t a server reply and I am getting pars=
e<br>
> error from Outlook. I am attaching a .msg file which my server receive=
d by<br>
> the smtp service I have developed. Please check. I have not written al=
l the<br>
> headers in this mail. I am retrieving all the header using mailbee<br>
> extension. It has a property named RawHeaders which retrieves all the<=
br>
> headers.<br>
><br>
> Thank You,<br>
> Sayantan Pal<br>
><br>
> On Wed, Jun 13, 2018 at 11:49 PM, Chris Newman <<a href=3D"mailto:c=
[email protected]" target=3D"_blank">[email protected]</a>><b=
r>
> wrote:<br>
>><br>
>> Implementing a mail server is probably much harder than you think =
it is.<br>
>> Good luck!<br>
>><br>
>> I recommend using an IMAP client that provides good diagnostics fo=
r<br>
>> testing.. Some programming languages, such as Python, include a li=
mited IMAP<br>
>> client library you can use for simple testing.<br>
>><br>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- Chr=
is<br>
>><br>
>><br>
>> On 13 Jun 2018, at 5:29, sayantan pal wrote:<br>
>><br>
>>>=C2=A0 Dear Team,<br>
>>><br>
>>>=C2=A0 =C2=A0 =C2=A0I am implementing my own mail server and th=
ereby developing IMAP<br>
>>> service by own following RFC3501 and 1705. I am unable to impl=
ement the<br>
>>> IMAP fetch header and body command. I am using Outlook 2007 as=
email<br>
>>> client. I have the log file for reference. I thereby requestin=
g for your<br>
>>> kind support to successfully fetch the header and body of a ma=
il.<br>
>>><br>
>>> Thanking You,<br>
>>> Sayantan Pal<br>
>>> _______________________________________________<br>
>>> imapext mailing list<br>
>>> <a href=3D"mailto:[email protected]" target=3D"_blank">imapext@=
ietf.org</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> imapext mailing list<br>
> <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a><br>
> <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>
><br>
</blockquote></div>
--000000000000d33cc0056ffe99a8--
--===============8821406948188556363==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
imapext mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/imapext
--===============8821406948188556363==--