Branch Coverage

lib/Sisimai/RFC3464.pm
Criterion Covered Total %
branch 90 114 78.9


line true false branch
20 0 181 unless keys %$mhead
21 0 181 unless ref $mbody eq "SCALAR"
66 2272 4331 unless ($readcursor)
68 117 2155 if ($d =~ /$markingsof->{'message'}/)
74 4148 2338 unless ($readcursor & $indicators->{'message-rfc822'})
76 124 4024 if ($d =~ /$markingsof->{'rfc822'}/)
82 2338 4024 if ($readcursor & $indicators->{'message-rfc822'}) { }
84 195 2143 unless (length $e)
85 81 114 if ++$blanklines > 1
92 2122 1902 unless $readcursor & $indicators->{'deliverystatus'}
93 423 1479 unless length $e
96 158 1321 if ($e =~ /\A(Original|Final)-[Rr]ecipient:[ ]*.+;[ ]*([^ ]+)\z/) { }
0 1321 elsif ($e =~ /\AX-Actual-Recipient:[ ]*(?:RFC|rfc)822;[ ]*([^ ]+)\z/) { }
121 1200 elsif ($e =~ /\AAction:[ ]*(.+)\z/) { }
121 1079 elsif ($e =~ /\AStatus:[ ]*(\d[.]\d+[.]\d+)/) { }
0 1079 elsif ($e =~ /\AStatus:[ ]*(\d+[ ]+.+)\z/) { }
38 1041 elsif ($e =~ /Remote-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/) { }
36 1005 elsif ($e =~ /\ALast-Attempt-Date:[ ]*(.+)\z/) { }
115 37 121 if ($1 eq 'Original') { }
123 0 121 unless "Sisimai::RFC5322"->is_emailaddress($y)
125 10 111 if ($x and $x ne $y)
140 0 0 unless $1 =~ /[ \t]+/
157 0 121 if $v->{'action'} =~ /\A([^ ]+)[ ]/
208 79 926 if ($e =~ /\ADiagnostic-Code:[ ]*(.+?);[ ]*(.+)\z/) { }
5 921 elsif ($e =~ /\ADiagnostic-Code:[ ]*(.+)\z/) { }
26 895 elsif (index($p, 'Diagnostic-Code:') == 0 and $e =~ /\A[ \t]+(.+)\z/) { }
232 111 784 if ($e =~ /\AReporting-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/) { }
50 734 elsif ($e =~ /\AReceived-From-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/) { }
88 646 elsif ($e =~ /\AArrival-Date:[ ]*(.+)\z/) { }
275 156 490 if $e =~ /\A[ -]+/
276 461 29 unless $e =~ /$markingsof->{'error'}/
292 111 70 if $recipients
295 18 52 if lc($mhead->{'from'}) =~ /\b(?:postmaster|mailer-daemon|root)[\@]/
296 6 64 if lc($mhead->{'subject'}) =~ qr/(?> delivery[ ](?:failed|failure|report) |failure[ ]notice |mail[ ](?:delivery|error) |non[-]delivery |returned[ ]mail |undeliverable[ ]mail |warning:[ ] ) /x
306 50 20 if (defined $mhead->{'return-path'})
308 18 32 if lc($mhead->{'return-path'}) =~ /(?:[<][>]|mailer-daemon)/
310 47 23 unless $match
378 1 151 if $d =~ /$markingsof->{'rfc822'}/
379 5 146 if $d =~ /$re_stop/
381 39 107 unless length $e
382 18 89 if $d =~ /$re_skip/
383 0 89 if index($e, "*") == 0
385 20 69 if ($d =~ /$re_addr/) { }
0 69 elsif ($e =~ /[(](?:expanded|generated)[ ]from:?[ ]([^\@]+[\@][^\@]+)[)]/) { }
389 0 20 unless "Sisimai::RFC5322"->is_emailaddress($y)
391 0 20 if ($x and $x ne $y)
407 50 131 unless $itisbounce
409 0 131 if ($recipients == 0 and $rfc822text =~ /^To:[ ]*(.+)/m)
411 0 0 if (my $r = "Sisimai::Address"->find($1, 1))
413 0 0 if scalar @$dscontents == $recipients
419 0 131 unless $recipients
427 29 0 if (exists $e->{'alterrors'} and $e->{'alterrors'})
430 0 29 if (index($e->{'diagnosis'}, "-") == 0 or substr($e->{'diagnosis'}, -2, 2) eq "__")
432 0 0 if $e->{'alterrors'}
438 12 129 if ($mdabounced)
442 12 0 if $mdabounced->{'message'}
447 0 141 if $e->{'diagnosis'} =~ /$markingsof->{'command'}/