Remove logging of queue ID - It's virtually never available and just clutters logs.

This commit is contained in:
Scott Kitterman 2012-02-03 22:42:16 -05:00
commit 2f5a4ff1ba

View file

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