procmail
[Top] [All Lists]

Re: external 'IP-Blacklist'

2004-02-02 15:40:57
Toen ik multimedia-fan(_at_)myrealbox(_dot_)com kietelde, kwam er dit uit:

 ## Get the IP address from the Received line.
 :0
 * ^Received:.*\[\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
 { TCPREMOTEIP = ${MATCH} }

That gets the number from the topmost (=most recent) 
Received-header only. Often that is not the one you need. 

The IP-Chain approach I used, collected the IP-addresses 
from all Received-headers, skipping the known and local 
ones. 

Just as an example:
To get a [dotted-number] from the 3rd Received-header:

  :0
  *         -3^0
  *$ $SUPREMUM^0
  *          1^1 ^Received:.*\[\
                  \/[0-9]+(\.[0-9]+)+
  { DOTNR3 = $MATCH }

But beware, Received-headers are volatile and contain 
[dotted numbers] that are Microsoft? version codes.


A way to match a number between 0 and 255:
  (([1-9]?|1[0-9])[0-9]|2([0-4][0-9]|5[0-5]))
Maybe it needs a 0* in front, to allow 001 etc.

-- 
Affijn, Ruud

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

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