procmail
[Top] [All Lists]

Re: | vs. ? And another basic question

2003-01-08 08:57:14
 Hi Don, 
You can do what you want, but not that way.  First off, all these
regexps are hosed because the [ and ] characters are special - denoting
character classes.  If you want to match a special chracter literally,
it needs to be backwacked (backslash escaped) (e.g \[). Also, you don't
care what that last octet is, but it will be there so you have to allow
for it.

Try:

* ^Received:.*\[212\.154\.3[2-6]\...?.?]

Your ending string is what I proposed as a solution.
I'm waiting on a book on procmail, so my education so far is the QuickStart
Guide. I'm trying to be careful, and I'm not sure why the brackets were set
as they were for the entire string. I received this instruction from another
"Don" whose example I followed, who knows much more than I do.

His explanation for the setting off the brackets is as follows:
The above recipe does not check all of those as many are
reported with square brackets instead of parens.  Parens work
well for testing the pair server applied header, but apparently
for checking previous recvd headers this recipe should be
expanded to use either parens or square brackets (be careful, as
the meta character rules are different within character classes).

=> :0
=> * ^Received:.*[[(]209\.163.\.100.[0-9][0-9]?[0-9]?[])]
=> { some action here }

I have a concern that this range may be too broad and
would like to see other sites for spam from more than the 4
addresses mentioned above.

BTW: other spam recipes for testing IP ranges posted here
recently could probably be improved by including square brackets
as above.

So, I was trying to follow this logic, but I don't understand why the entire
string is enclosed in brackets.  Is he looking for literal brackets?

For some reason, the spam from 209.163.100.11/ 12 etc. is still making it
through my filters.

Jeff


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com
Tel . 724-458-7169
ICQ 19112253

"One man gives freely, yet grows all the richer; another withholds what he
should give, and only suffers lack." -  Proverbs 11:24 


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