Re: Filesystem functionality used by notmuch
[notmuch-archives.git] / e9 / 9269b47ab3c9a65e240112b82953356365b4de
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 701E9431FB6\r
6         for <notmuch@notmuchmail.org>; Tue, 15 May 2012 06:22:45 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id IRmS+LBF4hlc for <notmuch@notmuchmail.org>;\r
16         Tue, 15 May 2012 06:22:43 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id A3B37431FAE\r
20         for <notmuch@notmuchmail.org>; Tue, 15 May 2012 06:22:43 -0700 (PDT)\r
21 X-AuditID: 1209190c-b7fad6d000000920-e1-4fb258a216ab\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 40.13.02336.2A852BF4; Tue, 15 May 2012 09:22:42 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q4FDMfHf027957; \r
27         Tue, 15 May 2012 09:22:41 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4FDMdXL029979\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 15 May 2012 09:22:40 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SUHi3-0003J3-0g; Tue, 15 May 2012 09:22:39 -0400\r
37 Date: Tue, 15 May 2012 09:22:38 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Robert Horn <rjhorn@alum.mit.edu>\r
40 Subject: Re: Using procmail to set tags\r
41 Message-ID: <20120515132238.GO11804@mit.edu>\r
42 References: <m3vcjyl4kg.fsf@quad.robs.office>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 Content-Disposition: inline\r
46 In-Reply-To: <m3vcjyl4kg.fsf@quad.robs.office>\r
47 User-Agent: Mutt/1.5.21 (2010-09-15)\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsUixG6nrrsoYpO/wYFlwhbXb85kdmD0eLbq\r
50         FnMAYxSXTUpqTmZZapG+XQJXRue0mSwFjwQqnjxexd7AuJe3i5GTQ0LAROLl1iXMELaYxIV7\r
51         69lAbCGBfYwS9/erdjFyAdkbGCUmLj3JDpE4ySRxYB8LRGIJo8TpjWfBulkEVCVmPd3NAmKz\r
52         CWhIbNu/nBHEFgGKT5g5ixXEZhaQlvj2u5kJxBYWUJdY3/kLbCivgI7E1xVbgeIcQEN1JRYu\r
53         UIYIC0qcnPmEBaJVS+LGv5dgJSBjlv/jAAlzCuhJnG/aADZFVEBFYsrJbWwTGIVmIemehaR7\r
54         FkL3AkbmVYyyKblVurmJmTnFqcm6xcmJeXmpRbqGermZJXqpKaWbGEHhyynJs4PxzUGlQ4wC\r
55         HIxKPLxO6zf6C7EmlhVX5h5ilORgUhLljQjb5C/El5SfUpmRWJwRX1Sak1p8iFGCg1lJhFfM\r
56         DCjHm5JYWZValA+TkuZgURLnVdF65yckkJ5YkpqdmlqQWgSTleHgUJLg7Q4HahQsSk1PrUjL\r
57         zClBSDNxcIIM5wEabg9Sw1tckJhbnJkOkT/FqCglzpsPkhAASWSU5sH1wtLLK0ZxoFeEeatB\r
58         qniAqQmu+xXQYCagwY0sYINLEhFSUg2MLOIWqjMtq+yLWyboxKwMLP61he/k35T0hh0t2j+N\r
59         Ls0rDZGOm+jMa2EUvOq3oJ3/gf8Li2Z6CusWuO9/LL7k0tftvlGpzmFvlTbqzt52iuO+35V7\r
60         h9jtA9WskrV+HV8nmudRtYBTPs6ZKb1FSdXC4P+NyctWpqy11vtmVLpV/v/FBQstH2xRYinO\r
61         SDTUYi4qTgQAVBK9wgoDAAA=\r
62 Cc: notmuch@notmuchmail.org\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Tue, 15 May 2012 13:22:45 -0000\r
76 \r
77 Quoth Robert Horn on May 14 at  7:34 pm:\r
78 > Is it practical (and has anyone documented) using a procmail setup to\r
79 > set initial tags for messages using notmuch?\r
80\r
81 > I've just started using emacs-notmuch to read mail, and I'm using a\r
82 > system where I have procmail filters to bin mail by category into\r
83 > folders.  I can continue this using folder:value for searching, but one\r
84 > reason notmuch interests me is the potential to do more.\r
85\r
86 > It's practical for me to assign potentially overlapping tags with a more\r
87 > sophisticated procmail setup.  Notmuch tags enable having multiple tags\r
88 > on one email.\r
89\r
90 > I don't know enough about the procmail/notmuch process to see just how\r
91 > to make this happen.  I'm hoping that someone has already done something\r
92 > similar.\r
93 \r
94 I second Jani's suggestion of using notmuch tag commands from\r
95 notmuch's post-new hook if possible (or switching to using searches\r
96 instead of tags where that makes sense).  However, if you really need\r
97 the flexibility of procmail, I can think of two solutions:\r
98 \r
99 You can let procmail deliver to folders, like usual, and then use\r
100   notmuch tag tag:inbox folder:X +/-tags\r
101 in notmuch's post-new hook to apply tags based on folders (you might\r
102 want to add the tag 'new' to your new.tags in ~/.notmuch-config and\r
103 filter on tag:new instead of tag:inbox).  If you need multiple tags on\r
104 a message, let procmail deliver it to multiple folders.\r
105 \r
106 Alternatively, you can have procmail record the message ID and desired\r
107 tags of the message in a file and then apply those recorded tags in\r
108 your post-new hook.  This would achieve the tagging you want more\r
109 directly, without mixing in folders and multiple delivery.  The\r
110 difficulty would be getting a message ID you could later use in an id:\r
111 query.  Simply grabbing the value of the message-id header would work\r
112 most of the time, but there's a fair bit of logic for dealing with\r
113 strangely formed or completely malformed message-id headers\r
114 (see _parse_message_id).\r
115 \r
116 As far as I know, nobody has tried my second suggestion.  Most people\r
117 just switch to using notmuch queries (either to tag or simply to\r
118 search).\r