procmail
[Top] [All Lists]

Re: GREPing files in procmail conditions

2003-12-07 08:16:44
In your message dated Sun, 07 Dec 2003 15:19:08 +0100, Ralf said that ...

Another problem of mine:
I did not find a way to compare the To:-Header in procmail with a
grep-result. How-ever I get the legal users, what I lack is still a
method to compare the contents of To: to them. All rules I found until
now have the format
:0
^To:.*forsandy
!sandy

What I lack is a rule saying
"if a grep of the contents of the To:-Header over a file does / does not
~ produce a result"

Not sure if this is what your asking for, but here is what I use:

:0:
* ?formail -x"To:"\            # Get To: address
| egrep -is -f $HOME/whitelist # Compare to whitelist file
$DELIVER                       # Deliver if matched

-- 
Best Regards,

Tim Rice
---------------
Phuket Thailand


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