procmail
[Top] [All Lists]

Re: Matching on Variable Names

2001-05-09 06:54:46
Chris Haupt finds that this recipe doesn't work:

| COMPANY="ID"
| :0
| * ^To: test(_at_)onlinesports(_dot_)com
| * ^Subject:.*(${COMPANY})
| ! haupt

To get variable or command substitution in a regexp condition, you need to
add the "$" modifier at the beginning.  [See the procmailrc(5) man page.]

Also, the parentheses there aren't doing what you expect: they're acting as
groupers (broiled, please, not fried) rather than matching literal parenthe-
ses.  However, the left parenthesis in the actual text is getting matched as
part of the string that ".*" takes in and the right parenthesis in the actual
text doesn't need to be matched because you aren't right-anchoring the ex-
pression, so they parentheses in the regexp are doing no harm.

All told,

 * $ ^Subject:.*$COMPANY

is what you need there.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>