procmail
[Top] [All Lists]

Re: If VARIABLE = (this|orthis|orthat)

2001-11-28 15:46:31
Sean wrote:
If REPLYTO = any of those 3, then I want to put the message into a special
folder

:0:
* REPLYTO ?? 
(\<|^)(joe(_at_)aol\(_dot_)com|ed(_at_)msn\(_dot_)com|john(_at_)yahoo\(_dot_)com)(\>|$)
friends.mbx

In Timothy's case we already know that REPLYTO contains *only* the
address, though, so the condition could be simplified slightly:
  * REPLYTO ?? 
^^(joe(_at_)aol\(_dot_)com|ed(_at_)msn\(_dot_)com|john(_at_)yahoo\(_dot_)com)^^

If you have the text already assigned to a variable, using the grep
functionality above would necessitate echoing the text:

* ? echo $REPLYTO | fgrep -i -w -f $PMDIR/friends.dat

Again, if we assume that there's nothing but the address in REPLYTO,
this can be turned into just:
  * ? fgrep -i $REPLYTO $PMDIR/friends.dat

/HW
_______________________________________________
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>