Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to Zone11 msgids #1348

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions lib/Zonemaster/Engine/Test/Zone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -477,32 +477,32 @@ Readonly my %TAG_DESCRIPTIONS => (
'Unexpected RCODE value ({rcode}) on the MX query from name servers "{ns_ip_list}".', @_;
},
Z11_INCONSISTENT_SPF_POLICIES => sub {
__x # ZONE:Z11_INCONSISTENT_SPF_POLICIES
'The zone publishes different SPF policies on different name servers.', @_;
__ # ZONE:Z11_INCONSISTENT_SPF_POLICIES
'One or more name servers do not publish the same SPF policy as the others.';
},
Z11_DIFFERENT_SPF_POLICIES_FOUND => sub {
__x # ZONE:Z11_DIFFERENT_SPF_POLICIES_FOUND
'The following name servers returned the same SPF version 1 policy, but other name servers returned a different policy. Name servers: {ns_ip_list}.', @_;
'The following name servers returned the same SPF policy, but other name servers returned a different policy. Name servers: {ns_ip_list}.', @_;
},
Z11_NO_SPF_FOUND => sub {
__x # ZONE:Z11_NO_SPF_FOUND
'The zone does not publish an SPF policy.', @_;
'No SPF policy was found for {domain}.', @_;
},
Z11_SPF1_MULTIPLE_RECORDS => sub {
__x # ZONE:Z11_SPF1_MULTIPLE_RECORDS
'The following name servers returned more than one SPF version 1 policy. Name servers: {ns_ip_list}.', @_;
'The following name servers returned more than one SPF policy. Name servers: {ns_ip_list}.', @_;
},
Z11_SPF1_SYNTAX_ERROR => sub {
__x # ZONE:Z11_SPF1_SYNTAX_ERROR
'The SPF version 1 policy has a syntax error. Policy retrieved from the following nameservers: {ns_ip_list}.', @_;
'The SPF policy of {domain} has a syntax error. Policy retrieved from the following nameservers: {ns_ip_list}.', @_;
},
Z11_SPF1_SYNTAX_OK => sub {
__x # ZONE:Z11_SPF1_SYNTAX_OK
'The SPF version 1 policy has correct syntax.', @_;
'The SPF policy of {domain} has correct syntax.', @_;
},
Z11_UNABLE_TO_CHECK_FOR_SPF => sub {
__x # ZONE:Z11_UNABLE_TO_CHECK_FOR_SPF
'None of the name servers responded with an authoritative response to queries for SPF policies.', @_;
__ # ZONE:Z11_UNABLE_TO_CHECK_FOR_SPF
'None of the zone’s name servers responded with an authoritative response to queries for SPF policies.';
},
);

Expand Down Expand Up @@ -1545,7 +1545,7 @@ sub zone11 {
push @results, _emit_log( Z11_UNABLE_TO_CHECK_FOR_SPF => {} );
}
elsif ( List::MoreUtils::all { $_ eq '' } keys %spf_ns ) {
push @results, _emit_log( Z11_NO_SPF_FOUND => {} );
push @results, _emit_log( Z11_NO_SPF_FOUND => { domain => $zone->name } );
}
elsif ( scalar keys %spf_ns > 1 ) {
push @results, _emit_log( Z11_INCONSISTENT_SPF_POLICIES => {} );
Expand All @@ -1561,10 +1561,13 @@ sub zone11 {
my $spf_text = (values %ns_spf)[0][0];

if ( _spf_syntax_ok($spf_text) ) {
push @results, _emit_log( Z11_SPF1_SYNTAX_OK => {} );
push @results, _emit_log( Z11_SPF1_SYNTAX_OK => { domain => $zone->name } );
}
else {
push @results, _emit_log( Z11_SPF1_SYNTAX_ERROR => { ns_ip_list => join( q{;}, sort (keys %ns_spf) ) } );
push @results, _emit_log( Z11_SPF1_SYNTAX_ERROR => {
ns_ip_list => join( q{;}, sort (keys %ns_spf) ),
domain => $zone->name
} );
}
}

Expand Down
Loading