Branch Coverage

blib/lib/Mail/Milter/Authentication/Handler/DKIM.pm
Criterion Covered Total %
branch 65 118 55.0


line true false branch
53 36 0 unless exists $config->{'hide_domainkeys'}
54 0 0 if $config->{'hide_domainkeys'}
60 0 1371 if $self->{'failmode'}
66 163 1208 if (lc $header eq "dkim-signature")
71 163 0 if ($parsed)
74 163 0 if (defined $selector and defined $domain)
87 0 1371 if (lc $header eq "domainkey-signature")
88 0 0 if $self->show_domainkeys
94 0 196 if $self->{'failmode'}
97 65 131 if ($self->{'has_dkim'} == 0) { }
100 58 7 unless ($config->{'hide_none'})
112 2 129 if ($config->{'no_strict'})
120 0 131 if (my $error = $@)
136 0 131 if (my $error = $@)
152 0 194 if $self->{'failmode'}
153 63 131 if $self->{'has_dkim'} == 0
157 0 131 if ($self->{'carry'} ne '') { }
165 0 131 if (substr($dkim_chunk, -1) eq "\r")
176 0 131 if (my $error = $@)
188 65 131 if $self->{'has_dkim'} == 0
189 0 131 if $self->{'failmode'}
207 0 131 unless ($dkim->signatures)
208 0 0 unless ($config->{'hide_none'} and $dkim_result eq "none")
217 163 0 $otype eq 'Mail::DKIM::Signature' ? :
0 163 $otype eq 'Mail::DKIM::DkSignature' ? :
229 101 62 if ($signature_result eq "pass")
233 24 139 if ($signature_result eq "invalid")
234 0 24 if ($signature_result_detail =~ /DNS query timeout for (.*) at /u)
242 62 101 if ($signature_result ne "pass" and $signature_result ne "none")
244 62 0 if ($1)
248 163 0 unless ($config->{'hide_none'} and $signature_result eq "none")
259 163 0 $key_type eq 'rsa' ? :
265 163 0 if $key_size
267 163 0 if $hash_algorithm
279 0 163 if ($type eq 'domainkeys') { }
280 0 0 if ($self->show_domainkeys)
285 0 0 if ($config->{'extra_properties'})
286 0 0 if $key_size
288 0 0 if $hash_algorithm
300 163 0 if $key_type and $hash_algorithm
302 12 151 if ($config->{'extra_properties'})
303 12 0 if $key_size
312 36 2 if ($config->{'check_adsp'} and $self->is_local_ip_address == 0 and $self->is_trusted_ip_address == 0 and $self->is_authenticated == 0)
326 36 0 $otype eq 'Mail::DKIM::DkPolicy' ? :
36 36 $otype eq 'Mail::DKIM::DkimPolicy' ? :
36 72 $otype eq 'Mail::DKIM::AuthorDomainPolicy' ? :
336 72 36 $default ? :
338 0 108 if $type eq "x-dkim-dkssp" and not $self->show_domainkeys
340 36 0 $apply eq 'neutral' ? :
0 36 $apply eq 'reject' ? :
72 36 $apply eq 'accept' ? :
346 108 0 unless ($config->{'adsp_hide_none'} and $result eq "none")
347 36 72 if (not $default or $config->{'show_default_adsp'})
349 0 36 $default ? :
36 0 $location ? :
362 0 131 if (my $error = $@)
387 0 0 if ($error =~ /^DNS error: query timed out/u or $error =~ /^DNS query timeout/u) { }
0 0 elsif ($error =~ /^DNS error: SERVFAIL/u) { }
0 0 elsif ($error =~ /^no domain to fetch policy for$/u or $error =~ /^policy syntax error$/u or $error =~ /^empty domain label/u or $error =~ /^invalid name /u) { }