Re: Procmail regex group reuse

Subject: Re: Procmail regex group reuse

Date: Wed, 13 Mar 2013 23:09:44 +0100

To: Istvan Marko

Cc: Notmuch

From: guyzmo+notmuch@m0g.net


Hello,

On Wed, Mar 13, 2013 at 12:16:29PM -0700, Istvan Marko wrote:
> Guyzmo <guyzmo+notmuch@m0g.net> 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

Thread: