[Mimedefang] RelayAddr

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Fri Sep 20 17:17:01 EDT 2002


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
> 
> -----Original Message-----
> From: Ashley M. Kirchner [mailto:ashley at pcraft.com] 
> Sent: Friday, September 20, 2002 3:01 PM
> To: MIMEDefang Mailing List
> Subject: [Mimedefang] RelayAddr
> 
> 
> 
>     I have this piece in my 'sub filter_begin()' part:
> 
> $LocalNetworks = [IPs blanked out];
> 
> sub filter_begin () {
>     # If the message came from localhost, let it through 
> without checking
>     if ($RelayAddr =~ /^(127.0.0.1|$LocalNetworks)/o) {
>         action_add_header("X-Relay-Status", "Skipped, internal relay:
> $RelayAddr");
>         return action_accept();
>     }
> ...
> ...
> }
> 
>     Yet, SpamAssassin still re-tags the message when I try to 
> re-send the
> message out (by running 'sendmail -f`cat SENDER` `cat RECIPIENTS` <
> ENTIRE_MESSAGE' within the quarantined folder).  Where should 
> that snippet
> be in the filter file so that once it verifies the RelayAddr, 
> it completely
> exits the filter and just delivers the message?
> 
>     Using MD 2.20
>           SA 2.41
> 
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   
> +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:ashley at pcraft.com>   .   
> 303.442.6410 x130
>   IT Director / SysAdmin / WebSmith             .     
> 800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 
> Arapahoe Ave. #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 
> 80303, U.S.A.
> 
> 
> 
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> 
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> 



More information about the MIMEDefang mailing list