[Mimedefang] RelayAddr

Marco Berizzi pupilla at hotmail.com
Sat Sep 21 07:26:01 EDT 2002


The "official way" suggested by David doesn't work for me:

 $RelayAddr =~ /^172\.16\.1$/

instead this work for me:

$RelayAddr =~ /^172\.16\.1/

The problem appears to be the "$" at the end (a typo?)
This is my simple piece of code.

if ($RelayAddr =~ /^172\.16\.1/) {
$LocalRelay = 1;
} else {
$LocalRelay = 0;
}

----- Original Message -----
From: <Matthew.van.Eerde at hbinc.com>
To: <mimedefang at lists.roaringpenguin.com>
Sent: Friday, September 20, 2002 11:16 PM
Subject: RE: [Mimedefang] RelayAddr


> It may be that the problem with the code as posted is the relatively
tight
> binding of the "|" operator in a regular expression:
> $RelayAddr =~ /^(127.0.0.1|$LocalNetworks)/o
>
> Perhaps this should be
> $RelayAddr =~ /^(127\.0\.0\.1)|($LocalNetworks)$/o
>
> It should also be verified that $LocalNetworks has its "|" families
suitably
> parenthesized
>
> $LocalNetworks =
> "(10\.\d{1,3}\.\d{1,3}\.\d{1,3})|(192\.168\.\d{1,3}\.\d{1,3})"
>
> All in all, it's probably clearer to write
>
> $RelayAddr eq "127.0.0.1" or
> $RelayAddr =~ /^10\./ or
> $RelayAddr =~ /^192\.168\./
>
> > -----Original Message-----
> > From: Stefano McGhee [mailto:SMcGhee at arcweb.com]
> > Sent: Friday, September 20, 2002 12:13
> > To: mimedefang at lists.roaringpenguin.com
> > Subject: RE: [Mimedefang] RelayAddr
> >
> >
> > Ashley,
> > That sounds exactly what I'm trying to accomplish for my server.
> > David sent a piece of code into the list like so:
> >
> > The "official" way is as follows:
> >
> > if ($RelayAddr eq "127.0.0.1" or
> >     $RelayAddr eq "ip.of.my.server" or
> >     $RelayAddr =~ /^ip\.of\.my-class-c$/) {
> > # Don't check for spam
> > } else {
> > # Check for spam
> > }
> >
> > This works with all versions of MIMEDefang.
> >
> > The problem with you're code, if I'm not mistaken, is that
> > action_accept
> > doesn't work on entire messages as action_discard does.  You
> > probably need
> > to implement his code rather than using action_accept.
> >
> > Cheers,
> >
> > Stefano
> >




More information about the MIMEDefang mailing list