procmail
[Top] [All Lists]

Re: Accept all mail sourced from IP address range

2006-06-30 15:09:04
On Fri, Jun 30, 2006 at 09:57:39PM +0200, Ruud H.G. van Tol wrote:

Robert Moskowitz schreef:

  MYPUB = 65\.0?84\.0?78\.(0?19[2-9]|0?2[0-4][0-9]|0?25[0-5])


I would make that:

   MYPUB = '(0?65\.0?84\.0?78\.(19[2-9]|2[0-4][0-9]|25[0-5]))'

The surrounding brackets are there to make it safe to use $MYPUB inside
regular expressions: ($MYPUB|$MYNAT128)

You showed me this once before privately a couple of years ago,
as I recall.  But I can't remember the case where it would matter.
Could you elucideate, please?

AFAIK, the 0? is to fill up to three digits.

Yup.  I think the script author's original premise was that some IP
addresses could come in with leading zeros.  I suppose some spammers'
could.  I've never seen any real, automatically produced (by mail
servers) IP addresses with leading zeros in the dotted quads, though.
Have you?


Be careful with those leading zeroes in other contextsthat E-mail
headers; some utilities (like ping) will consider such a numeral as
octal.

Theoretically could happen, I suppose.

Dallman

____________________________________________________________
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