Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/HashBL.pm
Criterion Covered Total %
branch 5 184 2.7


line true false branch
142 59 1 if ($mailsa->{'local_tests_only'}) { }
168 0 0 if (not defined $value or $value eq '')
183 0 0 unless (defined $acl)
187 0 0 unless ($acl =~ /^[a-z0-9]{1,32}$/)
191 0 0 if ($acl eq 'all')
194 0 0 if (defined $self->{'hashbl_acl'}{$acl})
203 0 0 if ($opt->{'key'} =~ /^hashbl_acl_([a-z0-9]{1,32})$/i)
205 0 0 unless $self->{'hashbl_available'}
211 0 0 if ($tmp =~ /^(\!)?(\S+)$/i) { }
215 0 0 if (defined $neg) { }
218 0 0 if $acl eq 'all'
220 0 0 unless (defined $self->{'hashbl_acl'}{$acl}{$value})
236 59 1 unless $self->{'hashbl_available'}
240 1 0 unless (exists $self->{'email_re'})
289 0 0 if exists $seen{$_}
292 0 0 if (defined $acl and $acl ne 'all' and defined $domain) { }
293 0 0 if (defined $self->{'hashbl_acl'}{$acl}{$domain} and $self->{'hashbl_acl'}{$acl}{$domain} eq 1)
310 0 0 if (exists $pms->{'hashbl_email_cache'}{$hdr})
314 0 0 if ($hdr eq 'ALLFROM')
319 0 0 unless (defined $pms->{'hashbl_whitelist'})
326 0 0 if (defined $pms->{'hashbl_whitelist'}{''})
332 0 0 if ($hdr eq 'ALL') { }
0 0 elsif ($hdr eq 'body') { }
338 0 0 if (defined $info->{'types'}{'a'} and not defined $info->{'types'}{'parsed'})
339 0 0 if ($uri =~ /^mailto:(.+)/i)
345 0 0 if ($opts =~ /\bnouri\b/)
349 0 0 if ($opts =~ /\bnoquote\b/)
363 0 0 if exists $seen{$1}
373 0 0 unless $self->{'hashbl_available'}
374 0 0 unless $pms->is_dns_available
375 0 0 unless $self->{'email_re'}
379 0 0 unless (defined $list)
384 0 0 if ($subtest)
386 0 0 unless ($rec)
394 0 0 unless $opts
396 0 0 unless $from
400 0 0 if (not @$emails) { }
401 0 0 if (defined $acl) { }
418 0 0 if exists $seen{$email}
419 0 0 if ($email =~ /$self->{'email_whitelist'}/ or defined $pms->{'hashbl_whitelist'}{$email})
423 0 0 if ($nodot or $notag)
425 0 0 if $nodot
426 0 0 if $notag
429 0 0 $keep_case ? :
434 0 0 if ($opts =~ /\bshuffle\b/)
439 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
440 0 0 if scalar @filtered_emails > $max
452 0 0 unless $self->{'hashbl_available'}
453 0 0 unless $pms->is_dns_available
457 0 0 unless (defined $list)
462 0 0 if ($subtest)
464 0 0 unless ($rec)
472 0 0 unless $opts
477 0 0 if ($opts =~ /raw/)
488 0 0 if $uri =~ /^mailto:/i
489 0 0 if exists $seen{$uri}
492 0 0 unless $info->{'hosts'}
493 0 0 unless $info->{'cleaned'}
494 0 0 unless $info->{'types'}{'a'} or $info->{'types'}{'parsed'}
497 0 0 $keep_case ? :
503 0 0 if ($opts =~ /\bshuffle\b/)
508 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
509 0 0 if scalar @filtered_uris > $max
521 0 0 unless $self->{'hashbl_available'}
522 0 0 unless $pms->is_dns_available
526 0 0 unless (defined $list)
531 0 0 unless ($re)
536 0 0 unless ($rec)
542 0 0 if ($subtest)
544 0 0 unless ($rec)
552 0 0 unless $opts
559 0 0 if (ref $bodyref eq 'ARRAY') { }
563 0 0 unless defined $1
564 0 0 $keep_case ? :
565 0 0 if exists $seen{$match}
573 0 0 unless defined $1
574 0 0 $keep_case ? :
575 0 0 if exists $seen{$match}
581 0 0 if (not @matches) { }
589 0 0 if ($opts =~ /\bshuffle\b/)
594 0 0 $opts =~ /\bmax=(\d+)\b/ ? :
595 0 0 if scalar @matches > $max
607 0 0 $opts =~ /\b(raw|sha1|md5)\b/i ? :
608 0 0 if ($hashtype eq 'sha1') { }
0 0 elsif ($hashtype eq 'md5') { }
620 0 0 if (exists $pms->{'conf'}{'hashbl_ignore'}{lc $value})
628 0 0 if (exists $pms->{'conf'}{'hashbl_ignore'}{$hash})
633 0 0 $list =~ s[/(A|TXT)$][]i ? :
650 0 0 if $ent
656 0 0 unless ($pkt)
662 0 0 $ent->{'subtest'} ? :
665 0 0 if ($rr->address =~ /$dnsmatch/)