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

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

Date: Fri, 09 Mar 2012 12:50:03 +0200

To: David Bremner, notmuch@notmuchmail.org

Cc: David Bremner

From: Tomi Ollila


On Thu,  8 Mar 2012 17:48:15 -0400, David Bremner <david@tethera.net> wrote:
> From: David Bremner <bremner@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

Thread: