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

MimeMessage.Prepare does not calculate maxLineLength correctly #497

Closed
nitinag opened this issue Aug 8, 2019 · 1 comment
Closed

MimeMessage.Prepare does not calculate maxLineLength correctly #497

nitinag opened this issue Aug 8, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@nitinag
Copy link

nitinag commented Aug 8, 2019

Looks like MimeMessage.Prepare is not counting CRLF, but only LF as a result of the following:
https://github.com/jstedfast/MimeKit/blob/master/MimeKit/IO/Filters/BestEncodingFilter.cs#L146

This results in the count being a character off in addition to not treating lines as CRLF.

Test:

var mimeMessage = MimeMessage.Load(new MemoryStream(Encoding.UTF8.GetBytes(@"From: [email protected]

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abc")));
mimeMessage.Prepare(MimeKit.EncodingConstraint.EightBit, 78);

The above message with max line length of 78 characters should result in ContentTransferEncoding == Default, but it is giving ContentTransferEncoding == QuotedPrintable.

jstedfast added a commit that referenced this issue Aug 8, 2019
@jstedfast
Copy link
Owner

Thanks.

@jstedfast jstedfast added the bug Something isn't working label Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants