Procmail regex group reuse
authorGuyzmo <guyzmo+notmuch@m0g.net>
Wed, 13 Mar 2013 15:16:30 +0000 (16:16 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:00 +0000 (09:54 -0800)
d2/11e2835bb420625a7ce587bdcfd7aac42edead [new file with mode: 0644]

diff --git a/d2/11e2835bb420625a7ce587bdcfd7aac42edead b/d2/11e2835bb420625a7ce587bdcfd7aac42edead
new file mode 100644 (file)
index 0000000..bf8b0bb
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <guyzmo@vilya.m0g.net>\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 F28AF431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 13 Mar 2013 08:16:46 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 1BLemM1bqXNg for <notmuch@notmuchmail.org>;\r
+       Wed, 13 Mar 2013 08:16:46 -0700 (PDT)\r
+Received: from mail.m0g.net (vilya.m0g.net [88.191.157.47])\r
+       by olra.theworths.org (Postfix) with ESMTP id 729AC431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 13 Mar 2013 08:16:46 -0700 (PDT)\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by mail.m0g.net (Postfix) with ESMTP id 1373B3E015B\r
+       for <notmuch@notmuchmail.org>; Wed, 13 Mar 2013 16:16:32 +0100 (CET)\r
+X-Virus-Scanned: Debian amavisd-new at vilya.m0g.net\r
+Received: from mail.m0g.net ([127.0.0.1])\r
+       by localhost (sd-38500.dedibox.fr [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id FFYqnmEJefHR for <notmuch@notmuchmail.org>;\r
+       Wed, 13 Mar 2013 16:16:31 +0100 (CET)\r
+Received: by mail.m0g.net (Postfix, from userid 1000)\r
+       id 418C63E2285; Wed, 13 Mar 2013 16:16:31 +0100 (CET)\r
+Date: Wed, 13 Mar 2013 16:16:30 +0100\r
+From: Guyzmo <guyzmo+notmuch@m0g.net>\r
+To: Notmuch <notmuch@notmuchmail.org>\r
+Subject: Procmail regex group reuse\r
+Message-ID: <20130313151630.GE14028@vilya.m0g.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+User-Agent: Mutt/1.5.21 (2011-07-01)\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: Wed, 13 Mar 2013 15:16:47 -0000\r
+\r
+Hello,\r
+\r
+    I have looked over that usage pattern over the procmail doc and\r
+mailing lists for some time now, and it seems no one ever asked the\r
+question:\r
+\r
+    Would it be possible to reuse a part of the match regexp in procmail\r
+so it can be reused in the action part of the rule. Something like the\r
+following:\r
+\r
+--------8<----------------8<----------------8<---------------8<--------\r
+:0:notmuch.lock\r
+* .*foo\+\(\w+\)@mydomain\.tld.*\r
+{ \r
+    TAGS="${TAGS} $1"\r
+}\r
+-------->8---------------->8---------------->8--------------->8--------\r
+\r
+    where "$1" would be the group match (like `\1` in sed). I used \r
+to do it easily when I was using sup, and I really miss it now that I\r
+have switched to notmuch.\r
+\r
+    Maybe I shall use another mail matching program like formail, or \r
+shall I write a patch for it, but I'd like first to ask here if someone \r
+had the same issue, and found a solution.\r
+\r
+-- \r
+Guyzmo\r