--- /dev/null
+Return-Path: <edward@4angle.com>\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 51C72431FBF\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Nov 2014 01:28:59 -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 vaAMix5hXE5Z for <notmuch@notmuchmail.org>;\r
+ Sat, 22 Nov 2014 01:28:54 -0800 (PST)\r
+Received: from 4angle.com (4angle.com [82.145.46.9])\r
+ (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id C5B82431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 22 Nov 2014 01:28:54 -0800 (PST)\r
+Received: from cpc19-cmbg14-2-0-cust212.5-4.cable.virginm.net ([86.6.30.213]\r
+ helo=x230)\r
+ by 4angle.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\r
+ (Exim 4.82) (envelope-from <edward@4angle.com>) id 1Xs6zo-0006Jj-Pg\r
+ for notmuch@notmuchmail.org; Sat, 22 Nov 2014 09:28:48 +0000\r
+Received: from edward by x230 with local (Exim 4.85_RC1-XX)\r
+ (envelope-from <edward@x230>) id 1Xs6zr-00045a-9v\r
+ for notmuch@notmuchmail.org; Sat, 22 Nov 2014 09:28:51 +0000\r
+Date: Sat, 22 Nov 2014 09:28:51 +0000\r
+From: Edward Betts <edward@4angle.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: exim pipe transport, notmuch insert and mbox-style messages\r
+Message-ID: <20141122092851.GA31815@x230>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12)\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: Sat, 22 Nov 2014 09:28:59 -0000\r
+\r
+My mail arrives on a Debian machine running exim. It was being filtered\r
+by procmail then piped into 'notmuch insert'. This was generating the\r
+single-message mbox warning:\r
+\r
+> Warning: ... is an mbox containing a single message,\r
+> likely caused by misconfigured mail delivery. Support for single-message\r
+> mboxes is deprecated and may be removed in the future.\r
+\r
+I thought it was a problem with procmail delivering mbox style messages to\r
+pipes, so I switched to maildrop. Same problem. This warning is produced\r
+because there is an mbox-style From_ line before the first header line. Here\r
+is an example:\r
+\r
+> From MAILER-DAEMON Fri Jul 8 12:08:34 2011\r
+\r
+The man page for maildrop says this style of message isn't supported, but it\r
+doesn't detect and warn about them. It will pipe them into commands without\r
+removing the From_ line.\r
+\r
+Reading the exim documentation for pipe transports I found the message_prefix\r
+option, which is by default is set like this:\r
+\r
+> message_prefix = \\r
+> From ${if def:return_path{$return_path}{MAILER-DAEMON}}\\r
+> ${tod_bsdinbox}\n\r
+\r
+This means that exim turns all messages into mbox style messages before\r
+delivering them to a pipe. The justification given in the documentation is\r
+"This is required by the commonly used /usr/bin/vacation program."\r
+\r
+The fix is to unset the exim message_prefix option for delivery to maildrop.\r
+Here is an example of the Debian exim maildrop_pipe transport with a blank\r
+message_prefix to stop the From_ line being added before the message is piped\r
+to maildrop.\r
+\r
+> maildrop_pipe:\r
+> debug_print = "T: maildrop_pipe for $local_part@$domain"\r
+> driver = pipe\r
+> path = "/bin:/usr/bin:/usr/local/bin"\r
+> command = "/usr/bin/maildrop"\r
+> message_prefix =\r
+> message_suffix =\r
+> return_path_add\r
+> delivery_date_add\r
+> envelope_to_add\r
+\r
+The same fix could be applied for procmail pipe or a pipe from exim to\r
+'notmuch insert'.\r
+\r
+I submitted a Debian bug for exim4-config with my change as a patch. The\r
+maintainer has excepted my patch and uploaded a release of exim4-config with\r
+the fix to Debian experimental. \r
+\r
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769396\r
+\r
+I wonder if 'notmuch insert' could be modified to detect and drop the From_\r
+line before writing the message to disk and index it. It could do that\r
+silently or with a warning.\r
+\r
+-- \r
+Edward.\r