emersion / go-imap

📥 An IMAP library for clients and servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v2: in body-type-1part: imapwire: expected number, got "-"

bepzoo opened this issue · comments

commented

Hello,

First of all thanks for this library, i realy appreciate your work.

Sometimes while fetching a mail with UIDFetch I get the following error:
in response-data: in body-type-mpart: in body-type-1part: in body-type-1part: imapwire: expected number, got \"-\"\ncould not fetch message from uid's"

This issue is new to v2 as it use to work with the v1 of the library
the fetched mail does contain a .eml file if it can help

If needed i can try to reproduce the error and provide you some logs

Yes, some logs would be useful.

commented

Here are the logs i get with the DebugWriter (i replaced the personnal data from the logs):

* 32 FETCH (UID 389 RFC822.SIZE 27824 BODY (("text" "plain" NIL NIL NIL "7bit" 155 1)("message" "feedback-report" NIL NIL NIL "7bit" 141)("message" "rfc822" NIL NIL NIL "8bit" 0 ("Thu, 8 Jun 2023 11:37:19 +0200" "=?utf-8?... =?utf-8?Q?023@ID61326?=" (("{.eml From}" NIL "{.eml From local part}" "{.eml From domain}")) ((NIL NIL "{.eml Sender local part}" "{.eml Sender domain}")) NIL NIL NIL NIL NIL "<{.eml messageID}>") ("multipart" "parallel" ("boundary" "_90b3ff09-0c78-477e-ac01-677ba1271137_") NIL NIL "7BIT" -1) 0) "report") ENVELOPE ("Thu, 8 Jun 2023 15:27:46 +0200" "{Subject}" ((NIL NIL "{From local part}" "{From domain}")) NIL ((NIL NIL "{Reply-To local part}" "{Reply-To domain}")) ((NIL NIL "{Received for local part}" "{Received for domain}")) NIL NIL NIL "{messageID}") INTERNALDATE "08-Jun-2023 15:27:46 +0200")

Here are some of the message details:

Content-Transfer-Encoding: binary
Content-Type: multipart/report; boundary="_----------=_16862308664961"

Here are some of the .eml attachment details:

MIME-Version: 1.0

--_90b3ff09-0c78-477e-ac01-677ba1271137_
------="_-------FVYFY8V92VBPYCMO-1638334957FVYFY8V92VBPYCMO=_:
Content-Type: multipart/parallel;
	boundary="_-------B2GEX6ARTNQPRMAD-1638334957B2GEX6ARTNQPRMAD=_:"

--_-------B2GEX6ARTNQPRMAD-1638334957B2GEX6ARTNQPRMAD=_:
Content-Type: multipart/alternative;
	boundary="_----------=bollinB2GEX6ARTNQPRMAD"

--_----------=bollinB2GEX6ARTNQPRMAD
Content-Type: text/html; charset="utf-8"

{some html}

--_----------=bollinB2GEX6ARTNQPRMAD--

--_-------B2GEX6ARTNQPRMAD-1638334957B2GEX6ARTNQPRMAD=_:--

--_90b3ff09-0c78-477e-ac01-677ba1271137_--

It seems like the error comes from:

("multipart" "parallel" ("boundary" "_90b3ff09-0c78-477e-ac01-677ba1271137_") NIL NIL "7BIT" -1)

It seems like body-fld-octets is set to -1. This is not allowed by the RFC.

commented

Thank you very much for the insight. Do you plan on handling this non-conventional case, as it use to work in v1 ? Or is their any workaround available on the lib for me to still be able to handle this kind of mail ?

Stop spamming random issues, please. This issue tracker is not for questions.

commented

Stop spamming random issues, please. This issue tracker is not for questions.

Excuse me, is this an error ? I don’t think i have spammed any issue

No. This was directed at another user, who appears to have since deleted their comments.