Branch Coverage

lib/Sisimai/Lhost/Postfix.pm
Criterion Covered Total %
branch 94 102 92.1


line true false branch
20 5 1451 if (index($mhead->{'subject'}, 'SMTP server: errors from ') > 0) { }
27 627 824 if $mhead->{'subject'} eq "Undelivered Mail Returned to Sender"
29 836 620 if $match == 0 or $mhead->{'x-aol-ip'}
57 5 615 if ($match == 2) { }
61 0 5 if scalar @$transcript == 0
68 5 35 if ($e->{'command'} eq 'EHLO' or $e->{'command'} eq 'HELO') { }
5 30 elsif ($e->{'command'} eq 'MAIL') { }
5 25 elsif ($e->{'command'} eq 'RCPT') { }
74 5 0 unless length $emailparts->[1]
78 0 5 if ($v->{'recipient'})
86 35 5 if int $p->{'reply'} < 400
101 3204 16504 unless ($readcursor)
103 560 2644 if grep {"Sisimai::String"->aligned(\$e, $_);} @{$$startingof{"message"}}
106 4041 12463 if ($readcursor & $indicators->{'deliverystatus'}) == 0 or $e eq ""
108 4310 8153 if (my $f = 'Sisimai::RFC1894'->match($e)) { }
110 0 4310 unless my $o = "Sisimai::RFC1894"->field($e)
113 1052 3258 if ($o->[3] eq 'addr') { }
560 2698 elsif ($o->[3] eq 'code') { }
116 1047 5 if ("Sisimai::Address"->is_emailaddress($o->[2]))
119 555 492 if ($o->[0] eq 'final-recipient') { }
121 15 540 if ($v->{'recipient'})
137 55 505 if uc $v->{'spec'} eq "X-POSTFIX"
142 0 2698 unless exists $$fieldtable{$o->[0]}
143 16 2682 if $o->[3] eq "host" and "Sisimai::RFC1123"->is_internethost($o->[2]) == 0
146 1593 1089 unless $f == 1
157 821 7332 if (index($p, 'Diagnostic-Code:') == 0 and index($e, ' ') != -1) { }
523 6809 elsif ('Sisimai::String'->aligned(\$e, ['X-Postfix-Sender:', 'rfc822;', '@'])) { }
168 603 6206 if (index($e, ' (in reply to ') != -1 or index($e, 'command)') != -1) { }
40 6166 elsif ('Sisimai::String'->aligned(\$e, ['<', '@', '>', '(expanded from <', '):'])) { }
509 5657 elsif (index($e, '<') == 0 and 'Sisimai::String'->aligned(\$e, ['<', '@', '>:'])) { }
5 5652 elsif (index($e, '--- Delivery report unavailable ---') != -1) { }
170 459 144 if $cv
171 581 22 if $anotherset->{'diagnosis'}
201 3656 1996 unless $anotherset->{'diagnosis'}
202 871 1125 if index($e, " ") == 0
212 75 545 unless ($recipients)
216 125 15 unless "Sisimai::Address"->is_emailaddress($anotherset->{$e})
222 60 15 if ($recipients == 0)
227 5 55 if ($nomessages and $p1 > 0)
235 55 565 unless $recipients
241 549 31 if ($anotherset->{'diagnosis'})
246 0 549 if ($e->{'diagnosis'} =~ /\A\d+\z/u) { }
255 187 362 if ("Sisimai::SMTP::Status"->is_ambiguous($e->{'status'}))
258 10 177 unless "Sisimai::SMTP::Status"->is_ambiguous($as)
261 549 0 if ($e->{'replycode'} eq "" or substr($e->{'replycode'}, -2, 2) eq "00")
264 481 68 if (length $ar > 0 and substr($ar, -2, 2) ne "00")
273 68 481 if length $as . $ar == 0
274 0 481 if length $anotherset->{'diagnosis'} < length $e->{'diagnosis'}
275 32 449 if index($anotherset->{'diagnosis'}, $e->{'diagnosis'}) == -1
284 39 541 if index($e->{'diagnosis'}, "refused to talk to me:") != -1
285 420 160 if "Sisimai::String"->aligned(\$e->{'diagnosis'}, ["host ", " said:"])