-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Failed to parse headers #395
Comments
I'm going to need a test case. You could just X-out the private info and I likely won't need the message body at all (just the headers). In other words: replace |
I will have a look and see if I can obfuscate the email and add a unit test specific for that. |
I would prefer not to have a public API that did that, but if the idea is to just unit test it, you could add an internal .ctor that takes a blockSize. The unit tests can invoke internal APIs. |
I found the commit that introduced the bug: 801ac47 |
Ok, I think I have an idea of what the problem is but if you could provide me with a test case that would still rock so that I could have a unit test for this and be sure that any fix I cook up actually works. |
Thanks for digging into this btw, I've been pretty swamped :) |
No problem at all. I'm just waiting to get approval from my company to send a PR |
Should be fixed now. Thanks for the PR with a way to replicate! |
It would be great if you can have a new nugget package version for this so I can put it to test. Thanks for having a look into this |
Experiencing the same issue, so following this. |
I'm currently away on a business trip of back-to-back meetings (w/ only my macbook) so can';t make/publish any nugets until at the earliest this weekend or early next week. I will do so as soon as I can - this bug is serious enough that it's worth making a new release on its own. |
You da man sir! |
I've just published MimeKit 2.0.4 to nuget.org (might take up to an hour before it shows up) |
I'm using MimeKit 2.0.3
I'm getting this error trying to parse an email headers.
System.FormatException : Failed to parse headers.
at MimeKit.MimeParser.ParseHeaders(Byte* inbuf, CancellationToken cancellationToken) in C:\GitHub\MimeKit\MimeKit\MimeParser.cs:line 1413
at MimeKit.MimeParser.ParseHeaders(CancellationToken cancellationToken) in C:\GitHub\MimeKit\MimeKit\MimeParser.cs:line 1445
I tried to debug a little bit the issue and I narrowed it down to this bit of code in MimeParser.cs:
If I change this line in the file:
const int BlockSize = 4096;
To
const int BlockSize = 4096 * 2;
The headers are parsed correctly and I don't get any exception.
I hope this is enough info but do please let me know if you need me to provide more info.
Unfortunately I cannot share the email itself.
The text was updated successfully, but these errors were encountered: