-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
QuotedPrintableEncoder max line length should be 76 instead of 71 #743
Comments
Why do you need it to be 76? (I'm not saying "no" to this change, I'm just curious). What you can do is to pre-encode the stream that you add to the MimeContent and also set the MimeContent's encoding to quoted-printable. When MimePart's WriteTo() method gets called, if the MimeContent stream is already encoded in the MimePart's ContentTransferENcoding, then no transforms are applied - it will just write the MimeContent's stream directly to the output. in other words: var content = new MimeContent (qpEncodedStream, ContentEncoding.QuotedPrintable);
var mimePart = new MimePart ("application", "octet-stream") {
ContentTransferEncoding = ContentEncoding.QuotedPrintable,
Content = content
}; Hope that clarifies what I mean.
Yea, I would consider adding this functionality similar to the way the Base64Encoder .ctor takes a |
Some gateways do re-encode messages again while passing through their systems. One example is SendGrid. if the message is signed then it is a problem to encode using a max line of 72 before sending and encoding to 76 in the gateway as it will corrupt the signature verification. I understand your solution, I will use it and let you know. |
SendGrid should not be re-encoding anything within a multipart/signed 😞 |
Use this value when creating the QuotedPrintable/Base64 encoder filter. Completes the fix for issue #743
Thank you for the commit. are you going to release this to nuget? |
This was included in the 3.1.0 release I made a day or 2 ago. |
When setting the ContentTransferEncoding property to ContentEncoding.QuotedPrintable the encoder encodes the lines so that each is maxed to 71 (other than the equals sign). According to the standard, the max should be 76. This might not be a problem when decoding, but for some reason, in our case, we need it to be 76. Is it possible that we improve the way a MimePart is composed so that we can inject our own encoder implementation? also, is it possible that the class QuotedPrintableEncoder itself has a constructor to specify the max length of the line?
The text was updated successfully, but these errors were encountered: