GNOME Bugzilla – Bug 751462
Include header name length when folding long lines
Last modified: 2015-06-25 20:54:46 UTC
Created attachment 306051 [details] [review] Protect header wrapping against reflowing Some mail that I sent to mailinglists got silently dropped because the mail ended up with a Face header that had more than 998 characters on a line. RFC 2822 section 2.1.1 specifies the maximum line length to be 998. When using the face plugin to configuring an image, a Face header is added to outgoing email. The header is base64 encoded and is typically longer than 998 characters. Evolution wraps the header as follows (which is technically correct): Face:<crlf> <tab>... 997 more characters ...<crlf> <tab>... However, some mail handling software (at least mailman and apparently also the Debian list software) seem to rewrite the header resulting in the following: Face:<space>... 997 more characters ...<crlf> <space>... which means the first line ends up as 1003 characters. While this technically may be a bug in the list software it is probably much easier to work around this in evolution than it is to fix all the deployed mail systems out there. The attached patch changes the wrapping to not start on the second line. This has the side effect of not having each line contain the same number of base64 characters but does mean that reflowing will not occur. This was first submitted in the Debian BTS (which contains exact version information, etc.): https://bugs.debian.org/789616
Thanks for a bug report. This is somewhat related to bug #750201.
I tested the patch and it works fine. The header name is still on its own line in the case of the long string, but when the two lines are concatenated, then they are exactly 998 letters + \r\n, which should be fine. Created commit d740341 in eds master (3.17.4+) Created commit 77c5e80 in eds gnome-3-16 (3.16.4+)