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 671680 - regression parsing single-message mbox files compared to gmime 2.4
regression parsing single-message mbox files compared to gmime 2.4
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
Depends on:
Blocks:
 
 
Reported: 2012-03-08 20:20 UTC by Daniel Kahn Gillmor
Modified: 2012-03-10 01:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
regression demonstration (1.15 KB, text/x-csrc)
2012-03-08 20:20 UTC, Daniel Kahn Gillmor
Details

Description Daniel Kahn Gillmor 2012-03-08 20:20:22 UTC
Created attachment 209283 [details]
regression demonstration

The attached test.c file demonstrates a simple pair of messages, one of which happens to be prepended with an mbox-style "From " line.

The message with the "From " line gets parsed cleanly by gmime 2.4, but gmime 2.6 fails to create a GMimeMessage from it.

Here's a transcript:

0 dkg@pip:~$ make
gcc -o test-2.6   -pthread -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/gmime-2.6  -pthread -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -Wall -Werror test.c
./test-2.6
scan_from: false
 msg: 0
scan_from: false
failed to create message
mbox: 3
0 dkg@pip:~$ make GMIME_VERSION=2.4
gcc -o test-2.4   -pthread -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/gmime-2.4  -pthread -lgmime-2.4 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -Wall -Werror test.c
./test-2.4
scan_from: false
 msg: 0
scan_from: false
mbox: 0
0 dkg@pip:~$ 

This came up in discussion on the notmuch mailing list [0], since some people seem to have maildirs that contain single-message files that happen to have the mbox-style header.

It's possible that this regression will cause the next version of notmuch to be released in debian to be linked against gmime-2.4 instead of gmime-2.6 as i was hoping :(

[0] http://thread.gmane.org/gmane.mail.notmuch.general/9851/focus=9949
Comment 1 Jeffrey Stedfast 2012-03-09 15:01:26 UTC
Thanks, I'll look at this over the weekend and see if I can find a fix.
Comment 2 Jeffrey Stedfast 2012-03-09 15:05:13 UTC
preliminary searching thru the ChangeLog file suggests it *might* be this patch:

2011-06-15  Jeffrey Stedfast  <fejj@gnome.org>

	* gmime/gmime-parser.c: Added new state, MESSAGE_HEADERS, which
	behaves the same as HEADERS but is only ever set when we are
	parsing the toplevel GMimeMessage object.
	(parser_step_headers): Be slightly more strict in handling
	malformed headers in the MESSAGE_HEADERS state so that trying to
	parse non-message streams fails (e.g. if someone tries to parse a
	jpeg stream).

Will dig more into this later, gotta run to the office
Comment 3 Jeffrey Stedfast 2012-03-10 01:56:38 UTC
fixed in git master, I'll make a release soon.