GNOME Bugzilla – Bug 671680
regression parsing single-message mbox files compared to gmime 2.4
Last modified: 2012-03-10 01:56:38 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
Thanks, I'll look at this over the weekend and see if I can find a fix.
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
fixed in git master, I'll make a release soon.