[Mimedefang] Still outbound messages are getting blocked by s pamassassin

Nels Lindquist nlindq at maei.ca
Wed Jul 21 17:54:00 EDT 2004


On 10 Jul 2004 at 13:13, alan premselaar wrote:

> I use a subroutine that allows me to be creative and/or easily expand my 
> list of machines/networks that can send email unfiltered. The code had 
> been posted to the list awhile back so i'm not going to take credit for 
> writing it. I obviously modified it for my own use.

I've attached another slightly different example based on the same 
code, which I believe was originally posted by James Ralston.

> I personally don't use ACCEPT_AND_NO_MORE_FILTERING because I still 
> force virus scans of outgoing mail, but i use these tests to bypass the 
> SpamAssassin tests as necessary.

Ditto.

----
Nels Lindquist <*>
Information Systems Manager
Morningstar Air Express Inc.


-------------- next part --------------
#############################################################################
# %PROCEDURE: is_in_subnet
# %ARGUMENTS:
#  hostip -- an IP address in numbers-and-dots notation (eg "127.0.0.1")
#  local_subnets -- a hash of subnet/netmask pairs in
#                   numbers-and-dots-notation
# %RETURNS:
#  1 if the IP address falls into one of the provided subnets; 0 if not
# %DESCRIPTION:
#  The is_in_subnet function tests to see whether the supplied IP address
#  is included within one of the provided subnets.  Based substantially on 
#  code  posted to the MIMEDefang list by James Ralston of Carnegie Mellon
#  University.
#
sub is_in_subnet($%) {

    use Socket;

    my $addr = '';
    my $network_string = '';
    my $mask_string = '';
    
    my ($hostip, %local_subnets) = @_;

    $addr = inet_aton($hostip);

    while (($network_string, $mask_string) = each %local_subnets) {
        my $network = inet_aton($network_string);
        my $mask = inet_aton($mask_string);
        if (($addr & $mask) eq $network) {
            return 1;
        }
    }

    return 0;

}


More information about the MIMEDefang mailing list