Procmail regex group reuse

Guyzmo guyzmo+notmuch at m0g.net
Wed Mar 13 08:16:30 PDT 2013


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


More information about the notmuch mailing list