Re: [PATCH] Add a new.filename_tags option
authorAustin Clements <amdragon@MIT.EDU>
Mon, 16 Apr 2012 16:09:50 +0000 (12:09 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:28 +0000 (09:46 -0800)
d9/8408dd7e3948c50c6c0e030ce3f9489c03a616 [new file with mode: 0644]

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