diff --git a/CHANGES b/CHANGES index 949f62e..a4262b4 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,10 @@ --- 2.010 2012-06-17 * Fixed incorrect use of != instead of ne for string comparison (LP: #1014243) + ! Changed non-standard X-Comment header fields for localhost and + whitelisted addresses to use RFC 5451 Authentication Results header + fields + ! Added depenency on Sys::Hostname::Long for local hostname determination --- 2.009 2012-02-03 * Chomp erroneus NULLs off the end of local and authority explanations to diff --git a/INSTALL b/INSTALL index edc3cec..3e13787 100644 --- a/INSTALL +++ b/INSTALL @@ -7,7 +7,8 @@ postfix-policyd-spf-perl: Perl 5.6 version NetAddr-IP 4 - Mail-SPF (not Mail-SPF-Query) version 2.006 or later + Mail::SPF (not Mail-SPF-Query) version 2.006 or later + Sys::Hostname::Long Installing ---------- diff --git a/postfix-policyd-spf-perl b/postfix-policyd-spf-perl index cd31cf4..06c9a51 100755 --- a/postfix-policyd-spf-perl +++ b/postfix-policyd-spf-perl @@ -31,6 +31,7 @@ use IO::Handle; use Sys::Syslog qw(:DEFAULT setlogsock); use NetAddr::IP; use Mail::SPF; +use Sys::Hostname::Long 'hostname_long'; # ---------------------------------------------------------- # configuration @@ -92,6 +93,10 @@ use constant relay_addresses => map( qw( ) ); # add addresses to qw ( ) above separated by spaces using CIDR notation. +# Fully qualified hostname, if available, for use in authentication results +# headers now provided by the localhost and whitelist checks. +my $host = hostname_long; + my %results_cache; # by message instance # ---------------------------------------------------------- @@ -187,7 +192,7 @@ sub exempt_localhost { my $attr = $options{attr}; if ($attr->{client_address} ne '') { my $client_address = NetAddr::IP->new($attr->{client_address}); - return 'PREPEND X-Comment: SPF not applicable to localhost connection - skipped check' + return "PREPEND Authentication-Results: $host; none (SPF not checked for localhost)" if grep($_->contains($client_address), localhost_addresses); }; return 'DUNNO'; @@ -202,7 +207,7 @@ sub exempt_relay { my $attr = $options{attr}; if ($attr->{client_address} ne '') { my $client_address = NetAddr::IP->new($attr->{client_address}); - return 'PREPEND X-Comment: SPF skipped for whitelisted relay' + return "PREPEND Authentication-Results: $host; none (SPF not checked for whitelisted relay)" if grep($_->contains($client_address), relay_addresses); }; return 'DUNNO';