[Mimedefang] Scanning inbound mail only

listuser at neo.pittstate.edu listuser at neo.pittstate.edu
Tue Dec 10 13:41:01 EST 2002


On Tue, 10 Dec 2002, David F. Skoll wrote:

> On Tue, 10 Dec 2002 listuser at neo.pittstate.edu wrote:
> 
> > Could someone help me with a regex to match an entire /24 with the
> > exception of a single IP?
> 
> Isn't that a little complicated?  Why not:
> 
> if ($RelayAddr ne "192.168.2.28" and $RelayAddr =~ /^192\.168\.2\./) {
> 	# This runs for any hosts in 192.168.2/24 EXCEPT for .28
> } else {
> 	# This runs for .28 and all other hosts
> }

That's quite a bit easier to read and understand.  Will there logic be a
problem if I have numerous OR statements as well as an AND?  ie, do I need
to utilize parantheses around the group of ORs to indicate expansion
preference (thinking back to logic from my EECE classes)?

      if ($RelayAddr ne "208\.46\.69\.2/ and
        $RelayAddr eq "127.0.0.1" or
        $RelayAddr =~ /^198\.248\.208\.13/ or
        $RelayAddr =~ /^208\.46\.69\./ or
        $RelayAddr =~ /^63\.150\.210\./ or
        $RelayAddr =~ /^63\.150\.211\./ or
        $RelayAddr =~ /^63\.237\.114\./ or
        $RelayAddr =~ /^63\.239\.149\./ or
        $RelayAddr =~ /^63\.239\.150\./ or
        $RelayAddr =~ /^65\.124\.226\./ or
        $RelayAddr =~ /^65\.127\.252\./ or
        $RelayAddr =~ /^65\.127\.253\./) {

Thanks
Justin




More information about the MIMEDefang mailing list