Re: [PATCH] add has: query prefix to search for specific properties
[notmuch-archives.git] / 9f / 6753c57f36405940591a7733edcf9471fe6254
1 Return-Path: <notmuch@kismala.com>\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 088A7431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 13 Mar 2013 12:16:33 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 uJDV1adWTEmp for <notmuch@notmuchmail.org>;\r
16         Wed, 13 Mar 2013 12:16:31 -0700 (PDT)\r
17 Received: from imarko.xen.prgmr.com (imarko.xen.prgmr.com [72.13.95.244])\r
18         by olra.theworths.org (Postfix) with ESMTP id B7483431FAE\r
19         for <notmuch@notmuchmail.org>; Wed, 13 Mar 2013 12:16:31 -0700 (PDT)\r
20 Received: from localhost ([127.0.0.1] helo=zsu.kismala.com)\r
21         by imarko.xen.prgmr.com with esmtp (Exim 4.80.1)\r
22         (envelope-from <notmuch@kismala.com>)\r
23         id 1UFrA5-0002Ja-UQ; Wed, 13 Mar 2013 12:16:30 -0700\r
24 From: Istvan Marko <notmuch@kismala.com>\r
25 To: Guyzmo <guyzmo+notmuch@m0g.net>, Notmuch <notmuch@notmuchmail.org>\r
26 Subject: Re: Procmail regex group reuse\r
27 In-Reply-To: <20130313151630.GE14028@vilya.m0g.net>\r
28 References: <20130313151630.GE14028@vilya.m0g.net>\r
29 User-Agent: Notmuch/0.15.2+47~g6daee9b (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 Date: Wed, 13 Mar 2013 12:16:29 -0700\r
32 Message-ID: <m31ubjrtyq.fsf@zsu.kismala.com>\r
33 MIME-Version: 1.0\r
34 Content-Type: text/plain\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Wed, 13 Mar 2013 19:16:33 -0000\r
48 \r
49 Guyzmo <guyzmo+notmuch@m0g.net> writes:\r
50 \r
51 >     Would it be possible to reuse a part of the match regexp in procmail\r
52 > so it can be reused in the action part of the rule. \r
53 \r
54 procmail has a limited way of extracting subexpressions:\r
55 \r
56        MATCH This variable is assigned to by procmail whenever it is\r
57              told to extract text from a matching regular expression.\r
58              It will contain all text matching the regular expression\r
59              past the `\/' token.\r
60 \r
61 So you get everything between \/ to the end of the whole regexp. In your\r
62 case this will get hairy because you need to match stuff after the part\r
63 you want to extract. The ?? construct might help to further trim it\r
64 down, maybe something like:\r
65 \r
66 * ^TO\/foo\+[a-z]+@mydomain\.tld\r
67 * MATCH ?? ^foo\+\/[a-z]+\r
68 {\r
69   TAG=$MATCH\r
70 }\r
71 \r
72 Or if you are willing to switch to maildrop it has pcre and proper\r
73 submatches.\r
74 \r
75 Are you tagging with notmuch-deliver?\r
76 \r
77 -- \r
78         Istvan\r