! 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
This commit is contained in:
parent
2aa104973f
commit
8c2ec2083f
3 changed files with 13 additions and 3 deletions
4
CHANGES
4
CHANGES
|
|
@ -7,6 +7,10 @@
|
||||||
--- 2.010 2012-06-17
|
--- 2.010 2012-06-17
|
||||||
* Fixed incorrect use of != instead of ne for string comparison
|
* Fixed incorrect use of != instead of ne for string comparison
|
||||||
(LP: #1014243)
|
(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
|
--- 2.009 2012-02-03
|
||||||
* Chomp erroneus NULLs off the end of local and authority explanations to
|
* Chomp erroneus NULLs off the end of local and authority explanations to
|
||||||
|
|
|
||||||
3
INSTALL
3
INSTALL
|
|
@ -7,7 +7,8 @@ postfix-policyd-spf-perl:
|
||||||
Perl 5.6
|
Perl 5.6
|
||||||
version
|
version
|
||||||
NetAddr-IP 4
|
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
|
Installing
|
||||||
----------
|
----------
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ use IO::Handle;
|
||||||
use Sys::Syslog qw(:DEFAULT setlogsock);
|
use Sys::Syslog qw(:DEFAULT setlogsock);
|
||||||
use NetAddr::IP;
|
use NetAddr::IP;
|
||||||
use Mail::SPF;
|
use Mail::SPF;
|
||||||
|
use Sys::Hostname::Long 'hostname_long';
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# configuration
|
# configuration
|
||||||
|
|
@ -92,6 +93,10 @@ use constant relay_addresses => map(
|
||||||
qw( )
|
qw( )
|
||||||
); # add addresses to qw ( ) above separated by spaces using CIDR notation.
|
); # 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
|
my %results_cache; # by message instance
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
@ -187,7 +192,7 @@ sub exempt_localhost {
|
||||||
my $attr = $options{attr};
|
my $attr = $options{attr};
|
||||||
if ($attr->{client_address} ne '') {
|
if ($attr->{client_address} ne '') {
|
||||||
my $client_address = NetAddr::IP->new($attr->{client_address});
|
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);
|
if grep($_->contains($client_address), localhost_addresses);
|
||||||
};
|
};
|
||||||
return 'DUNNO';
|
return 'DUNNO';
|
||||||
|
|
@ -202,7 +207,7 @@ sub exempt_relay {
|
||||||
my $attr = $options{attr};
|
my $attr = $options{attr};
|
||||||
if ($attr->{client_address} ne '') {
|
if ($attr->{client_address} ne '') {
|
||||||
my $client_address = NetAddr::IP->new($attr->{client_address});
|
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);
|
if grep($_->contains($client_address), relay_addresses);
|
||||||
};
|
};
|
||||||
return 'DUNNO';
|
return 'DUNNO';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue