unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Edward Betts <edward@4angle.com>
To: notmuch@notmuchmail.org
Subject: exim pipe transport, notmuch insert and mbox-style messages
Date: Sat, 22 Nov 2014 09:28:51 +0000	[thread overview]
Message-ID: <20141122092851.GA31815@x230> (raw)

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	other threads:[~2014-11-22  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22  9:28 Edward Betts [this message]
2014-11-22  9:44 ` exim pipe transport, notmuch insert and mbox-style messages David Bremner
2014-11-22 16:26   ` Andrei POPESCU
2014-11-29 12:57   ` Edward Betts
2014-11-29 13:21     ` David Bremner
2014-11-23 10:20 ` Tomi Ollila
2014-11-23 11:08   ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141122092851.GA31815@x230 \
    --to=edward@4angle.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).