On Wed, 19 Nov 2003, Dallman Ross wrote:
| egrep -is -f ${FILTERDIR}/whitelist
formail hands me the full address in the To: or From: or Whatever: field
The approach is fraught with several problems, and must be approached
with caution. One problem is that you will undermatch. For example,
without word boundaries, my own address in the whitelist -- dman --
would match against variants such as friedman, haldman, feldman, etc., etc.
I think that if the list is sorted by -u -f flags:
sort -u -f listfile
Then, you can use the command look(1) instead of *grep
It is faster:
look doma-in.here.org listfile
The command look(1) is looking in the list for the strings that
_START_ with the string that you gave. So, for domain names it
is O.K. because the name of domains are ended bye specific keywords.
For example, the domain *.gov will not confuse with *.governor
The bad side of look is the return code - it is always 0.
Bye,
Udi
If you are going to use grep, I'd recommend grep or fgrep, not egrep,
to eliminate regexes where they can only be trouble. ("ne.com" becomes
"netcom", etc.) I'd also use the -x option or at least -w to my grep.
And you probably want the -e flag, because some things you capture
and feed to grep will cause problems otherwise.
--
dman
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
--
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail