* Chomp erroneus NULLs off the end of local and authority explanations to

work around a Mail::SPF bug (in Mail::SPF versions prior to 2.008)
    - Patch thanks to Allison Randal
This commit is contained in:
Scott Kitterman 2012-01-25 22:54:02 -05:00
commit 39a6d9bcd6
2 changed files with 20 additions and 4 deletions

View file

@ -5,6 +5,9 @@
# * = Fixed a bug, or made a minor improvement
--- 2.009 UNRELEASED
* Chomp erroneus NULLs off the end of local and authority explanations to
work around a Mail::SPF bug (in Mail::SPF versions prior to 2.008)
- Patch thanks to Allison Randal
--- 2.008 (2012-01-19 13:46 -0500)
! Query only TXT and not DNS RR Type SPF records to reduce unnecessary DNS
lookups (LP: #161133)

View file

@ -250,8 +250,8 @@ sub sender_policy_framework {
}
my $helo_result_code = $helo_result->code; # 'pass', 'fail', etc.
my $helo_local_exp = $helo_result->local_explanation;
my $helo_authority_exp = $helo_result->authority_explanation
my $helo_local_exp = nullchomp($helo_result->local_explanation);
my $helo_authority_exp = nullchomp($helo_result->authority_explanation)
if $helo_result->is_code('fail');
my $helo_spf_header = $helo_result->received_spf_header;
@ -327,8 +327,8 @@ sub sender_policy_framework {
}
my $mfrom_result_code = $mfrom_result->code; # 'pass', 'fail', etc.
my $mfrom_local_exp = $mfrom_result->local_explanation;
my $mfrom_authority_exp = $mfrom_result->authority_explanation
my $mfrom_local_exp = nullchomp($mfrom_result->local_explanation);
my $mfrom_authority_exp = nullchomp($mfrom_result->authority_explanation)
if $mfrom_result->is_code('fail');
my $mfrom_spf_header = $mfrom_result->received_spf_header;
@ -360,3 +360,16 @@ sub sender_policy_framework {
return;
}
# ----------------------------------------------------------
# utility, string cleaning
# ----------------------------------------------------------
sub nullchomp {
my $value = shift;
# Remove one or more null characters from the
# end of the input.
$value =~ s/\0+$//;
return $value;
}