[PATCH] mime_node_open: check if the file is in mbox format, and inform gmime.

Tomi Ollila tomi.ollila at iki.fi
Fri Mar 9 02:50:03 PST 2012


On Thu,  8 Mar 2012 17:48:15 -0400, David Bremner <david at tethera.net> wrote:
> From: David Bremner <bremner at debian.org>
> 
> It seems that it has always been an error to try to parse an mbox
> format file with gmime without calling g_mime_parser_set_scan_from.

At least for the time being I think we should apply
http://en.wikipedia.org/wiki/Robustness_principle to this case
and accept email files that start with 'From '...

> This change reads the first 5 bytes of the file, and if they are "From ",
> declares the file to be an mbox.

an alternative to this is not to declare file as an mbox one but
if first line starts with 'From ' skip that line.

Whether this is a good idea or not I've already thought an implementation
how to do this which I'll post as an RFC patch in next 12 hours.


Tomi


More information about the notmuch mailing list