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