diff --git a/postfix-policyd-spf-perl b/postfix-policyd-spf-perl index 0e2da49..cb1c47f 100755 --- a/postfix-policyd-spf-perl +++ b/postfix-policyd-spf-perl @@ -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'; }