From: Edward Betts Date: Tue, 16 Dec 2014 11:31:33 +0000 (+0000) Subject: exim config for 'notmuch insert' retry X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f7916863f58c80d537c5ab292502d18b214850b7;p=notmuch-archives.git exim config for 'notmuch insert' retry --- diff --git a/5f/05c206c21d6876968922650a3de49a3bbf3c53 b/5f/05c206c21d6876968922650a3de49a3bbf3c53 new file mode 100644 index 000000000..8587e896c --- /dev/null +++ b/5f/05c206c21d6876968922650a3de49a3bbf3c53 @@ -0,0 +1,91 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 6A7E0431FC7 + for ; Tue, 16 Dec 2014 03:31:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id dSX-V4Q8+vvm for ; + Tue, 16 Dec 2014 03:31:41 -0800 (PST) +Received: from 4angle.com (4angle.com [82.145.46.9]) + (using TLSv1 with cipher AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 2318B431FC4 + for ; Tue, 16 Dec 2014 03:31:41 -0800 (PST) +Received: from cpc23-cmbg14-2-0-cust168.5-4.cable.virginm.net ([86.6.16.169] + helo=x230) + by 4angle.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) + (Exim 4.82) (envelope-from ) id 1Y0qLo-00051L-6A + for notmuch@notmuchmail.org; Tue, 16 Dec 2014 11:31:36 +0000 +Received: from edward by x230 with local (Exim 4.85_RC2) + (envelope-from ) id 1Y0qLl-0007RM-DY + for notmuch@notmuchmail.org; Tue, 16 Dec 2014 11:31:33 +0000 +Date: Tue, 16 Dec 2014 11:31:33 +0000 +From: Edward Betts +To: notmuch@notmuchmail.org +Subject: exim config for 'notmuch insert' retry +Message-ID: <20141216113133.GA25499@x230> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 16 Dec 2014 11:31:44 -0000 + +Short version: exim has an option to retry delivery when notmuch insert fails + +Long version: + +I'm using maildrop and 'notmuch insert' to sort and tag my incoming mail. +Sometimes 'notmuch insert' isn't able to write to the notmuch index because +another process is holding the notmuch write lock. At first when this happened +exim would just bounce the message. + +I could use the '--keep' option so 'notmuch insert' would write the message to +the maildir, but not index it. It would later be picked up by running 'notmuch +new' from cron. The problem is that the initial tagging is defined in the +maildrop config. I would need to specify my tagging rules in two different +places. + +For me, a better approach would be if the undeliverable message could be added +to a queue, ready for another delivery attempt. I realised that this is exactly +what an MTA like exim is designed to do. I added the 'temp_errors = 1' option +to the maildrop pipe transport, this tells exim that delivery errors are +temporary and it should retry failed deliveries. + +I'm sharing this information in case other people find it useful. + +Here is the complete maildrop pipe transport from my exim4.conf: + +maildrop_pipe: + driver = pipe + path = "/bin:/usr/bin:/usr/local/bin" + command = "/usr/bin/maildrop" + temp_errors = 1 + message_prefix = + message_suffix = + log_defer_output = true + return_path_add + delivery_date_add + envelope_to_add + +-- +Edward.