Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm
Criterion Covered Total %
branch 79 188 42.0


line true false branch
342 0 81 if $conf->{'skip_uribl_checks'}
344 77 4 if (not $pms->is_dns_available) { }
367 0 88 unless $conf->is_rule_active('body_evals', $rulename)
371 12 76 unless defined $tflags
375 0 88 if ($is_rhsbl and $tfl{'ips_only'}) { }
76 12 elsif ($is_rhsbl and $tfl{'domains_only'}) { }
12 0 elsif ($is_rhsbl) { }
0 0 elsif ($rulecf->{'is_fullnsrhsbl'}) { }
0 0 elsif ($rulecf->{'is_nsrhsbl'}) { }
386 0 0 if ($tfl{'a'})
389 0 0 if ($tfl{'ns'} or not $tfl{'a'})
399 4 0 unless $skip_domains
416 0 7 if $uri =~ /^mailto:/i
419 0 7 unless $info->{'hosts'}
423 0 7 if ($info->{'types'}{'a'}) { }
0 7 elsif ($info->{'types'}{'form'}) { }
0 7 elsif ($info->{'types'}{'img'}) { }
7 0 elsif ($info->{'types'}{'parsed'} and keys %{$$info{'types'};} == 1) { }
428 0 0 if (length $at)
446 0 7 if ($skip_domains->{$domain}) { }
462 12 3 unless $array
466 0 3 unless @hosts
469 3 0 if (keys(%hostlist) + @hosts <= $umd) { }
486 1 2 @hnames == 1 ? :
3 1 if @hnames
489 1 2 @dnames == 1 ? :
3 1 if @dnames
518 22 0 if ($subtest =~ m[^ ([^/-]+) (?: ([/-]) (.+) )? \z]sx)
522 10 34 if (not defined $_) { }
3 31 elsif (/^\d{1,10}\z/) { }
5 26 elsif (/^0x[0-9a-zA-Z]{1,8}\z/) { }
26 0 elsif (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/) { }
535 7 3 $any_quad_dot ? :
12 10 defined $n2 ? :
564 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
589 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
596 0 0 unless defined $subrule
617 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
642 22 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
649 0 22 unless defined $subrule
670 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
695 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
702 0 0 unless defined $subrule
723 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
748 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
755 0 0 unless defined $subrule
776 0 0 if ($value =~ /^$/)
790 0 0 if (not defined $value or $value eq '') { }
837 1 6 if ($host =~ /^\d+\.\d+\.\d+\.\d+$/) { }
841 1 0 if ($host =~ /^$IPV4_ADDRESS$/o and not $host =~ /^$IP_PRIVATE$/o)
846 1 0 if ($host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
857 7 0 if ($single_dnsbl)
862 1 6 if ($is_ip) { }
881 6 1 unless ($host =~ /^\d+\.\d+\.\d+\.\d+$/)
882 0 6 if (not $$seen_lookups{'NS:' . $domain} and %$nsreviprules || %$nsrhsblrules || %$fullnsrhsblrules)
887 0 6 if (%$areviprules and not $$seen_lookups{'A:' . $host})
921 0 0 unless ($pkt)
941 0 0 unless defined $str and defined $dom
944 0 0 if ($rr->type eq 'NS')
949 0 0 if ($nsmatch =~ /^\d+\.\d+\.\d+\.\d+$/) { }
951 0 0 if ($nsmatch =~ /^$IPV4_ADDRESS$/o and not $nsmatch =~ /^$IP_PRIVATE$/o)
957 0 0 unless ($$seen_lookups{'A:' . $nsmatch})
1006 0 0 unless ($pkt)
1017 0 0 if (not defined $hname) { }
0 0 elsif (not defined $str) { }
1025 0 0 if ($rr->type eq 'A')
1050 0 0 if defined $tflags->{$rulename} and $tflags->{$rulename} =~ /\b(?:ips_only|domains_only)\b/
1077 0 135 unless ($pkt)
1099 126 0 if ($rr_type eq 'A') { }
0 0 elsif ($rr_type eq 'TXT') { }
1101 126 0 $rr->UNIVERSAL::can('address') ? :
1103 126 0 if ($rdatastr =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
1117 0 126 !defined($subtest) ? :
1122 0 126 if (not defined $subtest) { }
0 126 elsif ($subtest eq $rdatastr) { }
126 0 elsif ($subtest =~ m[^ (\d+) (?: ([/-]) (\d+) )? \z]x) { }
1125 0 0 if ($rr_type eq 'A' and not $rdatastr =~ /^127\./)
1135 46 0 $delim eq '/' ? :
62 46 $delim eq '-' ? :
18 108 !defined($n2) ? :
1142 60 48 $n1 == $n2 ? :
18 108 !defined($n2) ? :
42 84 $match ? :
1149 42 84 if $match
1159 34 8 unless (defined $pms->{'uridnsbl_hits'}{$rulename})
1164 42 0 if ($pms->{'uridnsbl_active_rules_nsrevipbl'}{$rulename} or $pms->{'uridnsbl_active_rules_arevipbl'}{$rulename} or $pms->{'uridnsbl_active_rules_nsrhsbl'}{$rulename} or $pms->{'uridnsbl_active_rules_fullnsrhsbl'}{$rulename} or $pms->{'uridnsbl_active_rules_rhsbl'}{$rulename} or $pms->{'uridnsbl_active_rules_rhsbl_ipsonly'}{$rulename} or $pms->{'uridnsbl_active_rules_rhsbl_domsonly'}{$rulename})