Branch Coverage

blib/lib/Mail/Milter/Authentication/Handler/BIMI.pm
Criterion Covered Total %
branch 69 128 53.9


line true false branch
31 1 0 unless $sanitize_location_header eq "no"
32 1 0 unless $sanitize_indicator_header eq "no"
44 0 46 if $self->is_local_ip_address
45 0 46 if $self->is_trusted_ip_address
46 0 46 if $self->is_authenticated
47 0 46 if $self->{'failmode'}
49 7 39 if (lc $header eq "bimi-selector")
50 0 7 if (exists $self->{'selector'})
62 10 36 if (lc $header eq "from")
63 0 10 if (exists $self->{'from_header'})
87 0 0 if ($config->{'rbl_allowlist'} and $config->{'rbl_blocklist'})
92 0 10 if $self->{'header_added'}
93 0 10 if $self->is_local_ip_address
94 0 10 if $self->is_trusted_ip_address
95 0 10 if $self->is_authenticated
96 0 10 if $self->{'failmode'}
101 0 10 if (not $DMARCResults) { }
106 0 0 if (exists $top_handler->{'auth_headers'})
111 0 0 if (@auth_headers)
113 0 0 unless $auth_header->key eq "dmarc"
114 0 0 if ($auth_header->value eq "permerror")
129 0 10 if (scalar @$DMARCResults != 1) { }
145 2 8 if ($DMARCResult->result ne "pass")
148 2 0 if (exists $top_handler->{'auth_headers'})
153 2 0 if (@auth_headers)
155 7 2 if $auth_header->key ne "dmarc"
158 1 1 if ($arc_aware_result eq "pass")
170 3 7 if (not $Selector) { }
7 0 elsif ($Selector =~ /^v=BIMI1;\s+s=(\w+);?/iu) { }
182 7 0 if ($self->{'selector'})
184 4 3 if ($dkim_handler->{'has_dkim'})
186 4 0 if ($dkim_object)
187 4 0 if ($dkim_object->signatures)
189 0 4 if $signature->result ne "pass"
191 1 3 unless grep {lc $_ eq "bimi-selector";} @signed_headers
193 1 2 if (lc $signature_domain eq lc $Domain) { }
1 1 elsif (lc $signature_domain eq lc $OrgDomain) { }
207 1 3 $selector_was_third_party_domain_signed ? :
1 4 $selector_arc_pass ? :
1 5 $selector_was_org_domain_signed ? :
1 6 $selector_was_domain_signed ? :
212 4 3 if ($Alignment eq "unsigned" or $Alignment eq "thirdparty")
225 10 0 if ($SPFResults)
227 3 7 if lc $SPFResult->request->domain ne $Domain
233 0 10 if ($config->{'rbl_allowlist'}) { }
0 10 elsif ($config->{'rbl_blocklist'}) { }
235 0 0 unless ($self->rbl_check_domain($OrgDomain, $config->{'rbl_allowlist'}))
242 0 0 if ($self->rbl_check_domain($OrgDomain, $config->{'rbl_blocklist'}))
249 0 10 if exists $config->{'bimi_options'}
252 7 3 if $RelevantSPFResult
262 10 0 unless $Skip
264 0 10 if (my $Error = $@)
267 0 0 if ($Type)
268 0 0 if ($Type eq "Timeout")
270 0 0 if ($self->get_time_remaining > 0) { }
281 0 0 if (not $Skip and $config->{'rbl_no_evidence_allowlist'} and $Result->result eq "pass" and not $BIMI->record->authority && $BIMI->record->authority->vmc && $BIMI->record->authority->vmc->is_valid)
291 0 0 unless ($self->rbl_check_domain($OrgDomain, $config->{'rbl_no_evidence_allowlist'}))
298 0 10 if ($Skip) { }
310 8 2 if ($Result->result eq "pass")
312 8 0 if ($Headers)
313 8 0 if exists $Headers->{'BIMI-Location'}
314 8 0 if exists $Headers->{'BIMI-Indicator'}
325 0 10 if (my $error = $@)
328 0 0 if (not $self->{'header_added'})