! Only prepend a single SPF Received header for multi-recipient mail.
This commit is contained in:
parent
871b66f596
commit
0f355dacc2
4 changed files with 24 additions and 15 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# postfix-policyd-spf-perl
|
||||
# http://www.openspf.org/Software
|
||||
# version 2.001
|
||||
# version 2.002
|
||||
#
|
||||
#(C) 2007 Scott Kitterman <scott@kitterman.com>
|
||||
#(C) 2003-2004 Meng Weng Wong <mengwong@pobox.com>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
use version; our $VERSION = qv('2.001');
|
||||
use version; our $VERSION = qv('2.002');
|
||||
|
||||
use strict;
|
||||
|
||||
|
|
@ -51,6 +51,7 @@ my @HANDLERS = (
|
|||
my $VERBOSE = 0;
|
||||
|
||||
my $DEFAULT_RESPONSE = 'DUNNO';
|
||||
my $accepted = "UNDEF";
|
||||
|
||||
#
|
||||
# Syslogging options for verbose mode and for fatal errors.
|
||||
|
|
@ -120,7 +121,7 @@ while (<STDIN>) {
|
|||
syslog(debug => "Attribute: %s=%s", $_, $attr{$_});
|
||||
}
|
||||
}
|
||||
|
||||
my $instance = $attr{instance};
|
||||
my $action = $DEFAULT_RESPONSE;
|
||||
my %responses;
|
||||
# Skip SPF check for local connections
|
||||
|
|
@ -130,7 +131,12 @@ while (<STDIN>) {
|
|||
my $handler_code = $handler->{code};
|
||||
|
||||
my $response = $handler_code->(attr => \%attr);
|
||||
|
||||
|
||||
if($instance && $instance eq $accepted) {
|
||||
$response = 'DUNNO';
|
||||
}
|
||||
|
||||
|
||||
if ($VERBOSE) {
|
||||
syslog(debug => "handler %s: %s", $handler_name, $response);
|
||||
}
|
||||
|
|
@ -146,6 +152,7 @@ while (<STDIN>) {
|
|||
syslog(info => "%s: Policy action=%s", $attr{queue_id}, $action);
|
||||
|
||||
STDOUT->print("action=$action\n\n");
|
||||
$accepted = $instance;
|
||||
%attr = ();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue