My mail arrives on a Debian machine running exim. It was being filtered
by procmail then piped into 'notmuch insert'. This was generating the
single-message mbox warning:

> Warning: ...  is an mbox containing a single message,
> likely caused by misconfigured mail delivery.  Support for single-message
> mboxes is deprecated and may be removed in the future.

I thought it was a problem with procmail delivering mbox style messages to
pipes, so I switched to maildrop. Same problem. This warning is produced
because there is an mbox-style From_ line before the first header line. Here
is an example:

> From MAILER-DAEMON Fri Jul  8 12:08:34 2011

The man page for maildrop says this style of message isn't supported, but it
doesn't detect and warn about them. It will pipe them into commands without
removing the From_ line.

Reading the exim documentation for pipe transports I found the message_prefix
option, which is by default is set like this:

> message_prefix = \
>   From ${if def:return_path{$return_path}{MAILER-DAEMON}}\
>   ${tod_bsdinbox}\n

This means that exim turns all messages into mbox style messages before
delivering them to a pipe. The justification given in the documentation is
"This is required by the commonly used /usr/bin/vacation program."

The fix is to unset the exim message_prefix option for delivery to maildrop.
Here is an example of the Debian exim maildrop_pipe transport with a blank
message_prefix to stop the From_ line being added before the message is piped
to maildrop.

> maildrop_pipe:
>   debug_print = "T: maildrop_pipe for $local_part@$domain"
>   driver = pipe
>   path = "/bin:/usr/bin:/usr/local/bin"
>   command = "/usr/bin/maildrop"
>   message_prefix =
>   message_suffix =
>   return_path_add
>   delivery_date_add
>   envelope_to_add

The same fix could be applied for procmail pipe or a pipe from exim to
'notmuch insert'.

I submitted a Debian bug for exim4-config with my change as a patch. The
maintainer has excepted my patch and uploaded a release of exim4-config with
the fix to Debian experimental. 

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769396

I wonder if 'notmuch insert' could be modified to detect and drop the From_
line before writing the message to disk and index it. It could do that
silently or with a warning.

-- 
Edward.

Reply via email to