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 71C56431FAF for ; Wed, 13 Mar 2013 15:10:03 -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 ZD7H1-cWjTLz for ; Wed, 13 Mar 2013 15:10:01 -0700 (PDT) Received: from mail.m0g.net (vilya.m0g.net [88.191.157.47]) by olra.theworths.org (Postfix) with ESMTP id 9F84E431FAE for ; Wed, 13 Mar 2013 15:10:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.m0g.net (Postfix) with ESMTP id B23C93E0E35; Wed, 13 Mar 2013 23:09:45 +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 aTGCvjsdW0TA; Wed, 13 Mar 2013 23:09:44 +0100 (CET) Received: by mail.m0g.net (Postfix, from userid 1000) id B95743E2497; Wed, 13 Mar 2013 23:09:44 +0100 (CET) Date: Wed, 13 Mar 2013 23:09:44 +0100 From: guyzmo+notmuch@m0g.net To: Istvan Marko Subject: Re: Procmail regex group reuse Message-ID: <20130313220943.GH14028@vilya.m0g.net> References: <20130313151630.GE14028@vilya.m0g.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2011-07-01) Cc: Notmuch 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 22:10:03 -0000 Hello, On Wed, Mar 13, 2013 at 12:16:29PM -0700, Istvan Marko wrote: > Guyzmo writes: > > 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. [...] > So you get everything between \/ to the end of the whole regexp. In your > case this will get hairy because you need to match stuff after the part > you want to extract. The ?? construct might help to further trim it > down, maybe something like: > > * ^TO\/foo\+[a-z]+@mydomain\.tld > * MATCH ?? ^foo\+\/[a-z]+ > { > TAG=$MATCH > } interesting, I'll try hacking around that… > Or if you are willing to switch to maildrop it has pcre and proper > submatches. or I may switch to maildrop, I used it at one point with courier for my imag installation, but always stuck to procmail before switching to sup, and naturally got back to procmail when I installed notmuch. > Are you tagging with notmuch-deliver? Yes, I am, is there best ways to filter incoming mails, as I'm using notmuch on the same host as my MTA? Thanks, -- Guyzmo