Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm
Criterion Covered Total %
branch 77 188 40.9


line true false branch
347 0 81 if $conf->{'skip_uribl_checks'}
348 77 4 unless $pms->is_dns_available
364 0 88 unless $conf->is_rule_active('body_evals', $rulename)
368 12 76 unless defined $tflags
372 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'}) { }
383 0 0 if ($tfl{'a'})
386 0 0 if ($tfl{'ns'} or not $tfl{'a'})
396 4 0 unless $skip_domains
413 0 7 if $uri =~ /^mailto:/i
416 0 7 unless $info->{'hosts'}
420 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) { }
425 0 0 if (length $at)
443 0 7 if ($skip_domains->{$domain}) { }
459 12 3 unless $array
463 0 3 unless @hosts
466 3 0 if (keys(%hostlist) + @hosts <= $umd) { }
483 1 3 @hnames == 1 ? :
486 1 3 @dnames == 1 ? :
515 22 0 if ($subtest =~ m[^ ([^/-]+) (?: ([/-]) (.+) )? \z]sx)
519 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/) { }
532 7 3 $any_quad_dot ? :
12 10 defined $n2 ? :
561 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
586 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
593 0 0 unless defined $subrule
614 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
639 22 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
646 0 22 unless defined $subrule
667 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
692 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
699 0 0 unless defined $subrule
720 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)$/) { }
0 0 elsif ($value =~ /^$/) { }
745 0 0 if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(.*?)\s*$/) { }
0 0 elsif ($value =~ /^$/) { }
752 0 0 unless defined $subrule
773 0 0 if ($value =~ /^$/)
787 0 0 if (not defined $value or $value eq '') { }
834 1 6 if ($host =~ /^\d+\.\d+\.\d+\.\d+$/) { }
838 1 0 if ($host =~ /^$IPV4_ADDRESS$/o and not $host =~ /^$IP_PRIVATE$/o)
843 1 0 if ($host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
854 7 0 if ($single_dnsbl)
859 1 6 if ($is_ip) { }
878 6 1 unless ($host =~ /^\d+\.\d+\.\d+\.\d+$/)
879 0 6 if (not $$seen_lookups{'NS:' . $domain} and %$nsreviprules || %$nsrhsblrules || %$fullnsrhsblrules)
884 0 6 if (%$areviprules and not $$seen_lookups{'A:' . $host})
917 0 0 unless ($pkt)
937 0 0 unless defined $str and defined $dom
940 0 0 if ($rr->type eq 'NS')
945 0 0 if ($nsmatch =~ /^\d+\.\d+\.\d+\.\d+$/) { }
947 0 0 if ($nsmatch =~ /^$IPV4_ADDRESS$/o and not $nsmatch =~ /^$IP_PRIVATE$/o)
953 0 0 unless ($$seen_lookups{'A:' . $nsmatch})
1001 0 0 unless ($pkt)
1012 0 0 if (not defined $hname) { }
0 0 elsif (not defined $str) { }
1020 0 0 if ($rr->type eq 'A')
1039 0 1 if ($obj->{'is_arevip'}) { }
1049 0 0 if $tflags =~ /\b(?:ips_only|domains_only)\b/
1060 0 135 if exists $pms->{'uridnsbl_seen_lookups'}{$qkey}
1080 0 135 unless ($pkt)
1102 126 0 if ($rr_type eq 'A') { }
0 0 elsif ($rr_type eq 'TXT') { }
1104 126 0 $rr->UNIVERSAL::can('address') ? :
1106 126 0 if ($rdatastr =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
1120 0 126 !defined($subtest) ? :
1125 0 126 if (not defined $subtest) { }
0 126 elsif ($subtest eq $rdatastr) { }
126 0 elsif ($subtest =~ m[^ (\d+) (?: ([/-]) (\d+) )? \z]x) { }
1128 0 0 if ($rr_type eq 'A' and not $rdatastr =~ /^127\./)
1138 46 0 $delim eq '/' ? :
62 46 $delim eq '-' ? :
18 108 !defined($n2) ? :
1145 60 48 $n1 == $n2 ? :
18 108 !defined($n2) ? :
42 84 $match ? :
1152 42 84 if $match
1162 34 8 unless (defined $pms->{'uridnsbl_hits'}{$rulename})
1167 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})