GNOME Bugzilla – Bug 697407
header folding logic doesn't use the same rfc2047 workarounds as the decoder
Last modified: 2013-04-06 03:38:00 UTC
From Paul Stevens: When a message with a long utf7 encoded lines passes through gmime every works as expected, except when a header is added to the message along the line. Consider below message. The quotation style was used to preserve indenting. ---- > From: test > To: test2 > Subject: qqqq wwwwwww [eee 1234]=?UTF-8?Q?=20=D0=95=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC?= > > 123 ---- when it gets parsed as-is, everything is alright - g_mime_object_to_string returns the message exactly as fed in. However, when a header is added after parsing the message, the subject line in this case gets re-wrapped in what appears to be an incorrect fashion. At least, thunderbird and other mail clients don't grok it any more. Say a header 'X-Test' is set on above message: g_mime_object_set_header(message->content, "X-Test", "testing"); g_mime_stream_reset(message->stream); g_mime_object_write_to_stream(message->content, message->stream); Now if I do g_mime_object_get_headers on the message->content GMimeMessage object I get: ---- > From: test > To: test2 > Subject: qqqq wwwwwww [eee > 1234]=?UTF-8?Q?=20=D0=95=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0 > =BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0 > =BC=D0=BC=D0=BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0 > =BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=20=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0 > =BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC=D0=BC?= > X-Test: testing ----
fixed in git master