Re: [PATCH] mime_node_open: check if the file is in mbox format, and inform gmime.
authorTomi Ollila <tomi.ollila@iki.fi>
Fri, 9 Mar 2012 10:50:03 +0000 (12:50 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:21 +0000 (09:45 -0800)
09/95beb0e48df25e08da8c713fa0d242fff09c72 [new file with mode: 0644]

diff --git a/09/95beb0e48df25e08da8c713fa0d242fff09c72 b/09/95beb0e48df25e08da8c713fa0d242fff09c72
new file mode 100644 (file)
index 0000000..fc40dc1
--- /dev/null
@@ -0,0 +1,73 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8B279431FB6\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 02:50:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id j4snxUMJg2iD for <notmuch@notmuchmail.org>;\r
+       Fri,  9 Mar 2012 02:50:05 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5B8E5431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 02:50:05 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 3748168055; Fri,  9 Mar 2012 12:50:03 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] mime_node_open: check if the file is in mbox format,\r
+       and inform gmime.\r
+In-Reply-To: <1331243295-27324-1-git-send-email-david@tethera.net>\r
+References: <87vcme3kf6.fsf@pip.fifthhorseman.net>\r
+       <1331243295-27324-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.11.1+288~g4b3af0e (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Fri, 09 Mar 2012 12:50:03 +0200\r
+Message-ID: <m2aa3qjbfo.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 09 Mar 2012 10:50:06 -0000\r
+\r
+On Thu,  8 Mar 2012 17:48:15 -0400, David Bremner <david@tethera.net> wrote:\r
+> From: David Bremner <bremner@debian.org>\r
+> \r
+> It seems that it has always been an error to try to parse an mbox\r
+> format file with gmime without calling g_mime_parser_set_scan_from.\r
+\r
+At least for the time being I think we should apply\r
+http://en.wikipedia.org/wiki/Robustness_principle to this case\r
+and accept email files that start with 'From '...\r
+\r
+> This change reads the first 5 bytes of the file, and if they are "From ",\r
+> declares the file to be an mbox.\r
+\r
+an alternative to this is not to declare file as an mbox one but\r
+if first line starts with 'From ' skip that line.\r
+\r
+Whether this is a good idea or not I've already thought an implementation\r
+how to do this which I'll post as an RFC patch in next 12 hours.\r
+\r
+\r
+Tomi\r