Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting vmime::exception::invalid_response on email fetching #159

Closed
paukonen opened this issue Jan 17, 2017 · 5 comments
Closed

Getting vmime::exception::invalid_response on email fetching #159

paukonen opened this issue Jan 17, 2017 · 5 comments

Comments

@paukonen
Copy link

Hello!

I received this exception while I was trying to fetch email with latest git version of vmime.
Response looks like this:
[^]* 4 FETCH (BODYSTRUCTURE (("text" "plain" ("charset" "utf-8") NIL NIL "8bit" 536 0 NIL NIL NIL NIL)("text" "html" ("charset" "utf-8") NIL NIL "8bit" 7130 0 NIL NIL NIL NIL) "alternative" ("boundary" NIL)))

Error is permanent.

@vincent-richard
Copy link
Member

Hello!

Is this a new error, or did it also occur in previous versions?
Which is the IMAP server returning this?

At first sight, it seems "...("boundary" NIL)..." is an invalid syntax.
The IMAP RFC gives the following grammar for body-fld-param:

body-fld-param  = "(" string SP string *(SP string SP string) ")" / nil

And string is either a quoted or a literal, NIL is forbidden (not to be confused with nstring, which explicitly allows NIL).

Thanks,

Vincent

@paukonen
Copy link
Author

It's not a new error, I also get this error on git version I downloaded some time ago (29.04.2016).

Server is imap.mail.ru.
I created test account last month, and it has several emails in INBOX.
I tried downloading this message with Thunderbird and it downloads email fine without any errors.

I'm attaching full vmime trace log, maybe it can help to understand the problem.
vmime.txt

Is there anything else I can send you? I can provide you with login and password to this test account to check this problem by yourself, if needed.

@paukonen
Copy link
Author

Found couple of mentions of this problem with mail.ru server:
https://www.ietf.org/mail-archive/web/imapext/current/msg05442.html
jstedfast/MailKit#124

So the problem seems to be in imap server. Thunderbird just treats this error more lightly and receives message despite of the error. Windows Live Mail also receives this email. Could you please add some code replacing nil with empty string or something like that, so that message could be received?

@vincent-richard
Copy link
Member

Thank you for all these information. I have fixed the issue by providing a parsing workaround in non-strict mode (the default).

@paukonen
Copy link
Author

Thank you! Fix is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants