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

Cannot parse invalid message-id #976

Closed
breedbekkikker opened this issue Jan 21, 2020 · 3 comments
Closed

Cannot parse invalid message-id #976

breedbekkikker opened this issue Jan 21, 2020 · 3 comments
Labels
compatibility Compatibility with existing software

Comments

@breedbekkikker
Copy link

Hi,

While fetching the IMessageSummaries of a folder (with MailKit), a parsing error occurs because of an invalid message-id.

The stacktrace:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at MimeKit.Utils.ParseUtils.TryParseMsgId(Byte[] text, Int32& index, Int32 endIndex, Boolean requireAngleAddr, Boolean throwOnError, String& msgid)
   at MimeKit.Utils.MimeUtils.ParseMessageId(Byte[] buffer, Int32 startIndex, Int32 length)
   at MimeKit.Utils.MimeUtils.ParseMessageId(String text)
   at MailKit.Net.Imap.ImapUtils.<ParseEnvelopeAsync>d__40.MoveNext()

The MIME headers:

Date: Thu, 26 Dec 2019 08:01:12 +0100 (CET)
From: XYZ <abc@def.ghi>
Reply-To: abc@def.ghi
To: xyz@abc.def
Message-ID: ACME20191226@423549219_ACME20191226@
Subject: ACME
MIME-Version: 1.0
Content-Type: multipart/related; 
	boundary="----=_Part_4389_324343.157734362342342"

Is it possible to make a workaround for these kind of invalid message ids? Thanks.

@jstedfast jstedfast transferred this issue from jstedfast/MimeKit Jan 21, 2020
jstedfast added a commit that referenced this issue Jan 21, 2020
…Id to the raw nstring token value

Fixes issue #976
@jstedfast jstedfast added the compatibility Compatibility with existing software label Jan 21, 2020
@jstedfast
Copy link
Owner

Done ;-)

@breedbekkikker
Copy link
Author

Thanks, works like a charm!

@jstedfast
Copy link
Owner

Just released MailKit 2.5.1 with this fix.

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

No branches or pull requests

2 participants