diff --git a/postfix-policyd-spf-perl b/postfix-policyd-spf-perl index e77ded7..2357b13 100755 --- a/postfix-policyd-spf-perl +++ b/postfix-policyd-spf-perl @@ -170,7 +170,7 @@ while () { } } - syslog(info => "%s: Policy action=%s", $attr{queue_id} || '', $action || ''); + syslog(info => "Policy action=%s", $action || ''); STDOUT->print("action=$action\n\n"); %attr = (); @@ -239,8 +239,8 @@ sub sender_policy_framework { my $errmsg = $@; $errmsg = $errmsg->text if UNIVERSAL::isa($@, 'Mail::SPF::Exception'); syslog( - info => "%s:HELO check failed - Mail::SPF->new(%s, %s, %s) failed: %s", - $attr->{queue_id} || '', $attr->{client_address} || '', + info => "HELO check failed - Mail::SPF->new(%s, %s, %s) failed: %s", + $attr->{client_address} || '', $attr->{sender} || '', $attr->{helo_name} || '', $errmsg || '' ); @@ -258,8 +258,8 @@ sub sender_policy_framework { if ($VERBOSE) { syslog( - info => "%s: SPF %s: HELO/EHLO: %s, IP Address: %s, Recipient: %s", - $attr->{queue_id} || '', $helo_result || '', + info => "SPF %s: HELO/EHLO: %s, IP Address: %s, Recipient: %s", + $helo_result || '', $attr->{helo_name} || '', $attr->{client_address} || '', $attr->{recipient} || '' ); @@ -269,24 +269,24 @@ sub sender_policy_framework { # be accepted. Use the HELO result and return for null sender. if ($helo_result->is_code('fail')) { syslog( - info => "%s: SPF %s: HELO/EHLO: %s", - $attr->{queue_id} || '', $helo_result || '', + info => "SPF %s: HELO/EHLO: %s", + $helo_result || '', $attr->{helo_name} || '' ); return "550 $helo_authority_exp"; } elsif ($helo_result->is_code('temperror')) { syslog( - info => "%s: SPF %s: HELO/EHLO: %s", - $attr->{queue_id} || '', $helo_result || '', + info => "SPF %s: HELO/EHLO: %s", + $helo_result || '', $attr->{helo_name} || '' ); return "DEFER_IF_PERMIT SPF-Result=$helo_local_exp"; } elsif ($attr->{sender} eq '') { syslog( - info => "%s: SPF %s: HELO/EHLO (Null Sender): %s", - $attr->{queue_id} || '', $helo_result || '', + info => "SPF %s: HELO/EHLO (Null Sender): %s", + $helo_result || '', $attr->{helo_name} || '' ); return "PREPEND $helo_spf_header" @@ -317,8 +317,8 @@ sub sender_policy_framework { my $errmsg = $@; $errmsg = $errmsg->text if UNIVERSAL::isa($@, 'Mail::SPF::Exception'); syslog( - info => "%s: Mail From (sender) check failed - Mail::SPF->new(%s, %s, %s) failed: %s", - $attr->{queue_id} || '', $attr->{client_address} || '', + info => "Mail From (sender) check failed - Mail::SPF->new(%s, %s, %s) failed: %s", + $attr->{client_address} || '', $attr->{sender} || '', $attr->{helo_name} || '', $errmsg || '' ); return; @@ -335,8 +335,8 @@ sub sender_policy_framework { if ($VERBOSE) { syslog( - info => "%s: SPF %s: Envelope-from: %s, IP Address: %s, Recipient: %s", - $attr->{queue_id} || '', $mfrom_result || '', + info => "SPF %s: Envelope-from: %s, IP Address: %s, Recipient: %s", + $mfrom_result || '', $attr->{sender} || '', $attr->{client_address} || '', $attr->{recipient} || '' ); @@ -344,8 +344,8 @@ sub sender_policy_framework { # Same approach as HELO.... syslog( - info => "%s: SPF %s: Envelope-from: %s", - $attr->{queue_id} || '', $mfrom_result || '', + info => "SPF %s: Envelope-from: %s", + $mfrom_result || '', $attr->{sender} || '' ); if ($mfrom_result->is_code('fail')) {