Branch Coverage

blib/lib/Mail/Milter/Authentication/Protocol/SMTP.pm
Criterion Covered Total %
branch 136 260 52.3


line true false branch
26 0 163 if (exists $self->{'config'}{'smtp'}{$client_details}) { }
39 0 37 $smtp_config->{'queue_type'} eq 'before' ? :
51 168 43 if $self->{'smtp'}{'init_required'} == 0
102 37 0 unless ($self->{'smtp'}{'connect_ip'})
104 37 0 if ($self->{'smtp'}{'connect_ip'} eq '127.0.0.1') { }
132 0 331 if (my $error = $@)
138 0 331 unless ($command)
148 0 331 if (exists $smtp_config->{'debug_triggers'})
151 0 0 if ($command =~ /$trigger/u)
159 37 294 if ($uccommand =~ /^EHLO/u) { }
0 294 elsif ($uccommand =~ /^LHLO/u) { }
0 294 elsif ($uccommand =~ /^HELO/u) { }
126 168 elsif ($uccommand =~ /^XFORWARD/u) { }
42 126 elsif ($uccommand =~ /^MAIL FROM:/u) { }
42 84 elsif ($uccommand =~ /^RCPT TO:/u) { }
6 78 elsif ($uccommand =~ /^RSET/u) { }
42 36 elsif ($uccommand =~ /^DATA/u) { }
36 0 elsif ($uccommand =~ /^QUIT/u) { }
210 0 125 if ($smtp->{'fwd_ident'} and $smtp->{'fwd_ident'} ne "[UNAVAILABLE]")
219 247 0 if (length $command >= $index)
243 16 1551 if (@qstack and $c eq $qstack[-1]) { }
0 1551 elsif ($c eq '"') { }
16 1535 elsif ($c eq '<' and !@qstack || $qstack[-1] eq '>') { }
0 1535 elsif ($c eq '\\' and @qstack) { }
1 3067 elsif ($c eq ' ' and not @qstack) { }
260 0 83 @qstack ? :
272 0 0 if ($smtp->{'has_data'})
279 0 0 if ($self->queue_type eq 'before') { }
297 0 37 if ($smtp->{'has_data'})
304 0 37 if ($self->queue_type eq 'before') { }
322 0 0 if ($smtp->{'has_data'})
340 0 126 if ($smtp->{'has_data'})
348 42 84 if ($key eq 'NAME') { }
42 42 elsif ($key eq 'ADDR') { }
42 0 elsif ($key eq 'HELO') { }
0 0 elsif ($key eq 'IDENT') { }
358 0 0 if ($self->queue_type eq 'before') { }
401 0 6 if ($handler->{'exit_on_close'})
407 6 0 if ($smtp_conf->{'pipeline_limit'})
410 1 5 if ($count > $limit)
428 0 42 if ($smtp->{'has_data'})
433 0 42 if ($smtp->{'has_mail_from'})
444 0 42 if (substr($ip, 0, 5) eq "IPv6:")
454 42 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
456 42 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
460 42 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
514 0 42 if ($smtp->{'has_data'})
522 42 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
554 0 42 if ($smtp->{'has_data'})
569 0 1518 if ($dataline eq ".")
574 0 1518 if ($dataline =~ /^\./u)
577 42 1476 if ($dataline eq "")
584 0 42 if (my $error = $@)
594 985 491 if ($header_line =~ /^\s/u) { }
598 449 42 if ($value)
604 449 0 unless ($fail)
606 0 449 if ($returncode != 100)
614 42 0 if ($value)
620 42 0 unless ($fail)
622 0 42 if ($returncode != 100)
627 42 0 unless ($fail)
629 0 42 if ($returncode != 100)
637 0 42 if (exists $smtp_conf->{'chunk_limit'})
642 0 42 if (exists $smtp_conf->{'temp_dir'})
651 42 0 unless ($done)
658 42 674 if $dataline =~ /^\.\r\n/u
660 16 658 if ($dataline =~ /^\./u)
664 0 674 if ($temp_file) { }
671 0 674 if (length($body_chunk) + length($dataline) > $chunk_limit)
673 0 0 if ($returncode != 100)
683 42 0 unless ($fail)
685 0 42 if ($returncode != 100)
691 0 42 if (my $error = $@)
699 42 0 unless ($fail)
701 1 41 if ($returncode != 100)
708 41 1 if (not $fail) { }
1 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
710 0 41 if ($temp_file) { }
717 41 0 if ($self->smtp_forward_to_destination) { }
719 2 39 if (my $reject_reason = $handler->get_quarantine_mail) { }
729 0 41 if ($smtp->{'using_lmtp'}) { }
742 0 0 if ($upstream_error =~ /^4\d\d /u) { }
0 0 elsif ($upstream_error =~ /^5\d\d /u) { }
755 0 0 if ($smtp->{'using_lmtp'}) { }
768 0 1 if ($smtp->{'using_lmtp'}) { }
782 0 0 if ($smtp->{'using_lmtp'}) { }
795 0 0 if ($smtp->{'using_lmtp'}) { }
820 0 42 if ($handler->{'exit_on_close'})
877 5 36 if ($sock)
878 0 5 unless ($sock->connected)
884 36 5 unless ($sock)
888 0 36 if ($smtp_conf->{'sock_type'} eq 'inet') { }
36 0 elsif ($smtp_conf->{'sock_type'} eq 'unix') { }
905 0 36 unless ($sock)
912 0 36 if (my $error = $@)
918 0 36 if (!$line =~ /250/u)
928 36 5 if ($new_sock) { }
929 0 36 unless $self->send_smtp_packet($sock, "EHLO " . $smtp->{'server_name'}, 250)
932 0 5 unless $self->send_smtp_packet($sock, "RSET", 250)
935 41 0 if ($smtp->{'fwd_helo_host'})
936 0 41 unless $self->send_smtp_packet($sock, "XFORWARD HELO=" . $smtp->{'fwd_helo_host'}, 250)
938 41 0 if ($smtp->{'fwd_connect_ip'})
939 0 41 unless $self->send_smtp_packet($sock, "XFORWARD ADDR=" . $smtp->{'fwd_connect_ip'}, 250)
941 41 0 if ($smtp->{'fwd_connect_host'})
942 0 41 unless $self->send_smtp_packet($sock, "XFORWARD NAME=" . $smtp->{'fwd_connect_host'}, 250)
944 0 41 if ($smtp->{'fwd_ident'})
945 0 0 unless $self->send_smtp_packet($sock, "XFORWARD IDENT=" . $smtp->{'fwd_ident'}, 250)
948 0 41 unless $self->send_smtp_packet($sock, "MAIL FROM:" . $smtp->{'mail_from'}, 250)
950 0 41 unless $self->send_smtp_packet($sock, "RCPT TO:" . $rcpt_to, 250)
954 0 41 unless $self->send_smtp_packet($sock, "DATA", 354)
964 0 41 if ($spool) { }
991 0 41 unless $self->send_smtp_packet($sock, ".", 250)
1002 1 36 unless $sock
1003 0 36 unless $self->send_smtp_packet($sock, "QUIT", 221)
1014 41 323 if $status eq "."
1033 0 364 if (my $error = $@)
1045 364 0 if ($recv =~ /^$expect/u) { }
1071 49 88 if (substr(lc $header_v, 0, length($header) + 1) eq lc "${header}:")
1073 13 36 if ($search_i == $index)
1081 13 0 if ($result_i)
1082 13 0 if ($value eq '') { }