procmail
[Top] [All Lists]

Re: matching on bad word list but which word was it ?

2006-08-20 02:45:08
On Sun, Aug 20, 2006 at 10:40:27AM +0200, Matthias Haeker wrote:

i have a recipe like
:0
*  (bad1|bad2|bad3|bad4|bad5)
{ BADWORD = $MATCH  }

and i was thinking i can get that way  which  BADWORD  was matched in 
the var BADWORD

You need to use the match token, "\/" first to grab the word.
(See man procmailrc page and look for "'\/' token".)


   * ()\/(bad1|bad2|bad3|bad4|bad5)

The "()" is an empty group, used because a "naked" slash used
in that first position in the regex needs quoting, but slashes
in other positions don't.  We could also have used another slash
as a quote char, but the parens are easier to understand and
the "received wisdom" to use in this case among procmailers.

Dallman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail