Fix switch to use /etc/postfix/exempt_spf_addresses for skipped relays

This commit is contained in:
Scott Savarese 2018-07-29 13:02:49 -04:00 committed by Scott Kitterman
commit eae14d029d

View file

@ -255,7 +255,7 @@ sub exempt_localhost {
sub get_exempt_address {
my ( $file ) = @_;
my $list = {};
my $list = [];
# Return nothing if file not found
if ( ! -r $file ) {
@ -270,16 +270,8 @@ sub get_exempt_address {
}
close( FILE );
#$list => map(
# NetAddr::IP->new($_),
# qw( $text )
#); # add addresses to qw ( ) above separated by spaces using CIDR notation.
foreach my $addr ( split( /[\s,]+/, $text ) ) {
map(
NetAddr::IP->new($list),
qw( $addr )
);
push( @$list, NetAddr::IP->new($addr) );
}
return $list;
}
@ -290,7 +282,7 @@ sub exempt_relay {
if ($attr->{client_address} ne '') {
my $client_address = NetAddr::IP->new($attr->{client_address});
return "PREPEND Authentication-Results: $host; none (SPF not checked for whitelisted relay)"
if grep($_->contains($client_address), relay_addresses);
if grep($_->contains($client_address), @$relay_addresses);
};
return 'DUNNO';
}