Skip to content

Commit

Permalink
Merge pull request marcbradshaw#3 from damienmascre/master
Browse files Browse the repository at this point in the history
Corrects the $self->{result_reason} variable name for $self->{details…
  • Loading branch information
marcbradshaw committed Sep 13, 2019
2 parents 9a3b507 + f98196e commit 843d5d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions lib/Mail/DKIM/ARC/Signer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ our $VERSION = 0.56;
# $signer->{result}
# result of the signing policy: "signed" or "skipped"
#
# $signer->{result_reason}
# $signer->{details}
# why we skipped this signature
#
# $signer->{signature}
Expand Down Expand Up @@ -276,13 +276,13 @@ sub finish_header {
if ( $header =~ m/^ARC-/ ) {
if ( !$ar ) {
$self->{result} = 'skipped';
$self->{result_reason} =
$self->{details} =
'ARC header seen before Authentication-Results';
return;
}
if ( $self->{Chain} eq 'ar' ) {
$self->{result} = 'skipped';
$self->{result_reason} =
$self->{details} =
'No ARC result found in Authentication-Results';
return;
}
Expand All @@ -294,7 +294,7 @@ sub finish_header {
my $i = $seal->instance;
if ( $as[$i] ) {
$self->{result} = 'skipped';
$self->{result_reason} = "Duplicate ARC-Seal $i";
$self->{details} = "Duplicate ARC-Seal $i";
return;
}
$as[$i] = $seal;
Expand All @@ -304,7 +304,7 @@ sub finish_header {
my $i = $sig->instance;
if ( $ams[$i] ) {
$self->{result} = 'skipped';
$self->{result_reason} =
$self->{details} =
"Duplicate ARC-Message-Signature $i";
return;
}
Expand All @@ -314,7 +314,7 @@ sub finish_header {
my $i = $1;
if ( $aar[$i] ) {
$self->{result} = 'skipped';
$self->{result_reason} =
$self->{details} =
"Duplicate ARC-Authentication-Results $i";
return;
}
Expand All @@ -326,30 +326,30 @@ sub finish_header {

unless ($ar) {
$self->{result} = 'skipped';
$self->{result_reason} = 'No authentication results seen';
$self->{details} = 'No authentication results seen';
return;
}

if ( $#ams > $#as ) {
$self->{result} = 'skipped';
$self->{result_reason} = 'More message signatures than seals';
$self->{details} = 'More message signatures than seals';
return;
}
if ( $#aar > $#as ) {
$self->{result} = 'skipped';
$self->{result_reason} = 'More authentication results than seals';
$self->{details} = 'More authentication results than seals';
return;
}

foreach my $i ( 1 .. $#as ) {
unless ( $as[$i] ) {
$self->{result} = 'skipped';
$self->{result_reason} = "Missing ARC-Seal $i";
$self->{details} = "Missing ARC-Seal $i";
return;
}
unless ( $ams[$i] ) {
$self->{result} = 'skipped';
$self->{result_reason} = "Missing Arc-Message-Signature $i";
$self->{details} = "Missing Arc-Message-Signature $i";
return;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/arcsign.pl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
if( $arc->result eq "sealed") {
print join("\n",$arc->as_strings) . "\n";
} else {
print "REASON IS " . $arc->{result_reason} . "\n";
print "REASON IS " . $arc->{details} . "\n";
}

__END__
Expand Down

0 comments on commit 843d5d5

Please sign in to comment.