procmail
[Top] [All Lists]

Re: Getting the MATCH

2008-07-22 06:15:36
At 11:43 2008-07-22 +0200, Dallman Ross wrote:
[snipperoni]
Good comments, Sean.  One other one is that he is not using any
boundary anchors to the search string.  This will cause false
matches.  For example, what if feldman(_at_)example(_dot_)com were in the
blacklist but he ran dman(_at_)example(_dot_)com through his grep?  It would
match.  He needs the "w" flag with his grep, among other fixes.

[ipblacklist]
dman(_at_)example(_dot_)com

echo "feldman(_at_)example(_dot_)com" | fgrep -i -w -f ipblacklist

won't match, which is good.

echo "fel(_dot_)dman(_at_)example(_dot_)com" | fgrep -i -w -f ipblacklist

WOULD match, because the dot, which is really intended to be part of the string, is treated as a word separator. Obviously, this is a rather contrived example, but it does demonstrate that it'd potentially match things we don't want to match.

Includsion of the -w flag is even more important when dealing with ip dotted quad, since short initial and trailing octets could otherwise easily match much larger networks:

[ipblacklist]
1.23.45.6


11.23.45.61
201.23.45.69

(and MANY more) would match.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
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

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