-
-
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
Problem with headers' serialization #451
Comments
None of these things are causing DKIM-Signatures to fail. |
1 & 3. It causes DKIM check to fail with sendmail and opendkim. We've spent two days to determine issue and found that this serialization cause Also, 3 is really bug, should I create separate issue? |
No, I've got a fix already for issue 3 (just writing up some unit tests for it). If issues 1 and 3 are really causing failures in opendkim, then opendkim is buggy. MimeKit is producing perfectly valid folded headers according to the RFCs. I would dare you to prove otherwise. |
Here's the results with the Subject header folding fix:
|
If the first token we get to exceeds the SUGGESTED line length (78), don't add "\r\n " and then the token or we end up with: Subject:<SPACE> <SPACE><TOKEN> Instead, temporarily ignore the SUGGESTED line length (78) and forget the newline wrapping, thus producing: Subject:<SPACE><TOKEN> Partial fix for issue #451
May be DKIM is buggy, It is really acceptable. But it is widely used, and causes problems with DKIM. MimeKit is RFC compliant, I agree, but you can make it better and it will still follow RFC :) |
This concludes the fixes for issue #451
Next time, don't say "but it seems, there are big problems with header serialization" because that just wasn't true. These were both very minor and it was really a bug in opendkim. At most you could say that MimeKit produced results that were less than perfectly ideal, but when talking about rfc2047 encoding headers... good god, perfect is unachievable. For more reading, this is a great blog post by a Thunderbird developer: http://quetzalcoatal.blogspot.com/2013/10/why-email-is-hard-part-2.html |
FWIW, these are the latest results:
|
Thank you for fix. |
OpenDKIM indeed has a bug filed about this (multiple, actually). Here's one of them: https://sourceforge.net/p/opendkim/bugs/255/ It's been filed for over a year and the developer marked it as a duplicate of an even older bug :-\ |
I've just released MimeKit 2.1.0 with these fixes. |
Describe the bug
Headers are incorrectly serialized to raw values, as result DKIM can fail and mail clients are incorrectly displays subject.
To Reproduce
Test code:
Result:
Problems:
Currently, I 'fix' problem by trimming
Header.rawValue
for each headers (with reflection), and all became good, but it seems, there are big problems with header serialization.The text was updated successfully, but these errors were encountered: