From: Austin Clements Date: Mon, 16 Apr 2012 16:09:50 +0000 (+2000) Subject: Re: [PATCH] Add a new.filename_tags option X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=4a48d046cf2150481089cd860ce4c2089ec1700f;p=notmuch-archives.git Re: [PATCH] Add a new.filename_tags option --- diff --git a/d9/8408dd7e3948c50c6c0e030ce3f9489c03a616 b/d9/8408dd7e3948c50c6c0e030ce3f9489c03a616 new file mode 100644 index 000000000..cb9bdfde6 --- /dev/null +++ b/d9/8408dd7e3948c50c6c0e030ce3f9489c03a616 @@ -0,0 +1,111 @@ +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 512FA431FAF + for ; Mon, 16 Apr 2012 09:09:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yOF-7nJPJFNQ for ; + Mon, 16 Apr 2012 09:09:53 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id BA2F2431FAE + for ; Mon, 16 Apr 2012 09:09:53 -0700 (PDT) +X-AuditID: 1209190e-b7f7c6d0000008c3-31-4f8c4451b544 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 16.73.02243.1544C8F4; Mon, 16 Apr 2012 12:09:53 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q3GG9qt6024293; + Mon, 16 Apr 2012 12:09:53 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3GG9pA7009822 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 16 Apr 2012 12:09:52 -0400 (EDT) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1SJoUx-0001ye-01; Mon, 16 Apr 2012 12:09:51 -0400 +Date: Mon, 16 Apr 2012 12:09:50 -0400 +From: Austin Clements +To: Neil Roberts +Subject: Re: [PATCH] Add a new.filename_tags option +Message-ID: <20120416160950.GM13549@mit.edu> +References: <1334588499-3101-1-git-send-email-neil@linux.intel.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1334588499-3101-1-git-send-email-neil@linux.intel.com> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1g106fE3uHxG3OLk1EusFtdvzmR2 + YPKYdzLQ49mqW8wBTFFcNimpOZllqUX6dglcGUsX72QqaOav2PnkI2sD43fuLkZODgkBE4kV + z/awQdhiEhfurQeyuTiEBPYxSpy538MC4WxglNjxoBkqc5JJ4nnPayhnCaPEu8Ub2UH6WQRU + JU5PX88MYrMJaEhs27+cEcQWEVCXmHVkDhOIzSwgLfHtdzOYLSxgLHH4ezNYDa+AjsTUNY+B + hnIADXWW2LhFGiIsKHFy5hMWiFYtiRv/XjKBlICMWf6PAyTMKeAi8XrqDLALRAVUJKac3MY2 + gVFoFpLuWUi6ZyF0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrrJebWaKXmlK6iREc1JJ8 + Oxi/HlQ6xCjAwajEwzvTsMdfiDWxrLgy9xCjJAeTkijvbyegEF9SfkplRmJxRnxRaU5q8SFG + CQ5mJRHeGNlufyHelMTKqtSifJiUNAeLkjivmtY7PyGB9MSS1OzU1ILUIpisDAeHkgRvniXQ + UMGi1PTUirTMnBKENBMHJ8hwHqDh65yBaniLCxJzizPTIfKnGBWlxHl3gSQEQBIZpXlwvbCk + 84pRHOgVYd71IFU8wIQF1/0KaDAT0OD4ki6QwSWJCCmpBsZloj3PfmdMzj5rmfnPfMeMWPOc + H1eja1of713V7bz3ZEci498Noj/eemyvu7Kff67R9ZkhZ2TdYuLsn8Vc70rcESr77dD9BIWT + QYb3Fj3a/75qd4na531/z94pSf1Q4Pj40bGsf6qChb8a7lhmaFe7dFtvPftyCsvBKYI7RE8w + 9SuGJiZ3zVmnxFKckWioxVxUnAgAAsBN7xUDAAA= +Cc: notmuch@notmuchmail.org +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: Mon, 16 Apr 2012 16:09:54 -0000 + +Quoth Neil Roberts on Apr 16 at 4:01 pm: +> This option is similar to the existing new.tags option except that it +> is instead used when a new filename is encountered for an existing +> message. +> +> This can be used to do post-processing based on the filenames that a +> message has. For example, in my setup I use maildrop to filter the +> messages in to maildirs and then I have an extra script that runs to +> add the tags based on which folders maildrop put the message in. The +> script only looks at messages that have the 'inbox' tag and then +> removes the tag after processing. This works fine except sometimes I +> will get a message twice for example if I am CC'd in a message from a +> mailing list. In that case I want the message to be tagged twice, once +> to indicate it was sent directly to me and once to indicate it was +> sent to the mailing list. If one of these messages is delayed then I +> can end up processing the message once and removing the inbox tag. +> When the second message is finally received it would previously not +> get processed again so I would lose the second tag. With this patch I +> can configure it to re-add the inbox tag in this case to force it to +> reconsider the tags. + +This is an interesting idea. Unfortunately, the duplicate message-ID +code path you've modified is also used for rename detection. Hence, +if the user modifies the maildir from another MUA, new.filename_tags +will be applied if the message gets moved to another folder, or even +if they simply change the maildir flags (e.g., marking the message +read). + +I'm not sure exactly how your mail flow works, but would it be +possible to use folder-based tagging in your post-new hook to +accomplish this? E.g., + notmuch tag +debian folder:debian +Since this isn't filtered by any delivery tags, it will apply to any +message that winds up in folder:debian, regardless of when it gets +there.