[Mimedefang] RelayAddr

Stefano McGhee SMcGhee at ARCweb.com
Fri Sep 20 15:13:00 EDT 2002


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




More information about the MIMEDefang mailing list