After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697407 - header folding logic doesn't use the same rfc2047 workarounds as the decoder
header folding logic doesn't use the same rfc2047 workarounds as the decoder
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
2.6.x
Other All
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
Depends on:
Blocks:
 
 
Reported: 2013-04-06 03:32 UTC by Jeffrey Stedfast
Modified: 2013-04-06 03:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jeffrey Stedfast 2013-04-06 03:32:42 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
----
Comment 1 Jeffrey Stedfast 2013-04-06 03:38:00 UTC
fixed in git master