Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/HashBL.pm
Criterion Covered Total %
branch 5 186 2.6


line true false branch
154 60 1 if ($mailsa->{'local_tests_only'}) { }
180 0 0 if (not defined $value or $value eq "")
195 0 0 unless (defined $acl)
199 0 0 unless ($acl =~ /^[a-z0-9]{1,32}$/)
203 0 0 if ($acl eq "all")
206 0 0 if (defined $self->{'hashbl_acl'}{$acl})
215 0 0 if ($opt->{'key'} =~ /^hashbl_acl_([a-z0-9]{1,32})$/i)
217 0 0 unless $self->{'hashbl_available'}
223 0 0 if ($tmp =~ /^(\!)?(\S+)$/i) { }
227 0 0 if (defined $neg) { }
230 0 0 if $acl eq "all"
232 0 0 unless (defined $self->{'hashbl_acl'}{$acl}{$value})
248 60 1 unless $self->{'hashbl_available'}
252 1 0 unless (exists $self->{'email_re'})
301 0 0 if exists $seen{$_}
304 0 0 if (defined $acl and $acl ne 'all' and defined $domain) { }
305 0 0 if (defined $self->{'hashbl_acl'}{$acl}{$domain} and $self->{'hashbl_acl'}{$acl}{$domain} eq 1)
322 0 0 if (exists $pms->{'hashbl_email_cache'}{$hdr})
326 0 0 if ($hdr eq "ALLFROM")
331 0 0 unless (defined $pms->{'hashbl_whitelist'})
338 0 0 if (defined $pms->{'hashbl_whitelist'}{''})
344 0 0 if ($hdr eq 'ALL') { }
0 0 elsif ($hdr eq 'body') { }
350 0 0 if (defined $info->{'types'}{'a'} and not defined $info->{'types'}{'parsed'})
351 0 0 if ($uri =~ /^mailto:(.+)/i)
357 0 0 if ($opts =~ /\bnouri\b/)
361 0 0 if ($opts =~ /\bnoquote\b/)
375 0 0 if exists $seen{$1}
385 0 0 unless $self->{'hashbl_available'}
386 0 0 unless $pms->is_dns_available
387 0 0 unless $self->{'email_re'}
391 0 0 unless (defined $list)
396 0 0 if ($subtest)
398 0 0 unless ($rec)
406 0 0 unless $opts
408 0 0 unless $from
412 0 0 if (not @$emails) { }
413 0 0 if (defined $acl) { }
430 0 0 if exists $seen{$email}
431 0 0 unless $email =~ /.*\@.*/
432 0 0 if ($email =~ /$self->{'email_whitelist'}/ or defined $pms->{'hashbl_whitelist'}{$email})
436 0 0 if ($nodot or $notag)
438 0 0 if $nodot
439 0 0 if $notag
442 0 0 $keep_case ? :
447 0 0 if ($opts =~ /\bshuffle\b/)
452 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
453 0 0 if scalar @filtered_emails > $max
465 0 0 unless $self->{'hashbl_available'}
466 0 0 unless $pms->is_dns_available
470 0 0 unless (defined $list)
475 0 0 if ($subtest)
477 0 0 unless ($rec)
485 0 0 unless $opts
490 0 0 if ($opts =~ /raw/)
501 0 0 if $uri =~ /^mailto:/i
502 0 0 if exists $seen{$uri}
505 0 0 unless $info->{'hosts'}
506 0 0 unless $info->{'cleaned'}
507 0 0 unless $info->{'types'}{'a'} or $info->{'types'}{'parsed'}
510 0 0 $keep_case ? :
516 0 0 if ($opts =~ /\bshuffle\b/)
521 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
522 0 0 if scalar @filtered_uris > $max
534 0 0 unless $self->{'hashbl_available'}
535 0 0 unless $pms->is_dns_available
539 0 0 unless (defined $list)
544 0 0 unless ($re)
549 0 0 unless ($rec)
555 0 0 if ($subtest)
557 0 0 unless ($rec)
565 0 0 unless $opts
572 0 0 if (ref $bodyref eq 'ARRAY') { }
576 0 0 unless defined $1
577 0 0 $keep_case ? :
578 0 0 if exists $seen{$match}
586 0 0 unless defined $1
587 0 0 $keep_case ? :
588 0 0 if exists $seen{$match}
594 0 0 if (not @matches) { }
602 0 0 if ($opts =~ /\bshuffle\b/)
607 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
608 0 0 if scalar @matches > $max
620 0 0 $opts =~ /\b(raw|sha1|md5)\b/i ? :
621 0 0 if ($hashtype eq 'sha1') { }
0 0 elsif ($hashtype eq 'md5') { }
633 0 0 if (exists $pms->{'conf'}{'hashbl_ignore'}{lc $value})
641 0 0 if (exists $pms->{'conf'}{'hashbl_ignore'}{$hash})
646 0 0 $list =~ s[/(A|TXT)$][]i ? :
663 0 0 if $ent
669 0 0 unless ($pkt)
675 0 0 $ent->{'subtest'} ? :
678 0 0 if ($rr->address =~ /$dnsmatch/)