Branch Coverage

blib/lib/Mail/Milter/Authentication/Protocol/SMTP.pm
Criterion Covered Total %
branch 125 244 51.2


line true false branch
30 0 135 if (exists $self->{'config'}{'smtp'}{$client_details}) { }
43 0 30 $smtp_config->{'queue_type'} eq 'before' ? :
56 140 36 if $self->{'smtp'}{'init_required'} == 0
109 30 0 unless ($self->{'smtp'}{'connect_ip'})
111 30 0 if ($self->{'smtp'}{'connect_ip'} eq '127.0.0.1') { }
139 0 275 if (my $error = $@)
145 0 275 unless ($command)
155 0 275 if (exists $smtp_config->{'debug_triggers'})
158 0 0 if ($command =~ /$trigger/)
166 30 245 if ($uccommand =~ /^EHLO/) { }
0 245 elsif ($uccommand =~ /^LHLO/) { }
0 245 elsif ($uccommand =~ /^HELO/) { }
105 140 elsif ($uccommand =~ /^XFORWARD/) { }
35 105 elsif ($uccommand =~ /^MAIL FROM:/) { }
35 70 elsif ($uccommand =~ /^RCPT TO:/) { }
6 64 elsif ($uccommand =~ /^RSET/) { }
35 29 elsif ($uccommand =~ /^DATA/) { }
29 0 elsif ($uccommand =~ /^QUIT/) { }
218 0 104 if ($smtp->{'fwd_ident'} and $smtp->{'fwd_ident'} ne '[UNAVAILABLE]')
227 205 0 if (length $command >= $index)
242 0 0 if ($smtp->{'has_data'})
249 0 0 if ($self->queue_type eq 'before') { }
268 0 30 if ($smtp->{'has_data'})
275 0 30 if ($self->queue_type eq 'before') { }
294 0 0 if ($smtp->{'has_data'})
313 0 105 if ($smtp->{'has_data'})
321 35 70 if ($key eq 'NAME') { }
35 35 elsif ($key eq 'ADDR') { }
35 0 elsif ($key eq 'HELO') { }
0 0 elsif ($key eq 'IDENT') { }
331 0 0 if ($self->queue_type eq 'before') { }
374 6 0 if ($smtp_conf->{'pipeline_limit'})
377 1 5 if ($count > $limit)
397 0 35 if ($smtp->{'has_data'})
402 0 35 if ($smtp->{'has_mail_from'})
413 0 35 if (substr($ip, 0, 5) eq 'IPv6:')
423 35 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
425 35 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
430 35 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
486 0 35 if ($smtp->{'has_data'})
494 35 0 if ($returncode == 100) { }
0 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
528 0 35 if ($smtp->{'has_data'})
543 0 1003 if ($dataline eq '.')
548 0 1003 if ($dataline =~ /^\./)
551 35 968 if ($dataline eq '')
558 0 35 if (my $error = $@)
568 585 383 if ($header_line =~ /^\s/) { }
572 348 35 if ($value)
578 348 0 unless ($fail)
580 0 348 if ($returncode != 100)
588 35 0 if ($value)
594 35 0 unless ($fail)
596 0 35 if ($returncode != 100)
601 35 0 unless ($fail)
603 0 35 if ($returncode != 100)
611 0 35 if (exists $smtp_conf->{'chunk_limit'})
616 0 35 if (exists $smtp_conf->{'temp_dir'})
622 35 0 unless ($done)
629 35 567 if $dataline =~ /^\.\r\n/
631 16 551 if ($dataline =~ /^\./)
635 0 567 if ($temp_file) { }
642 0 567 if (length($body_chunk) + length($dataline) > $chunk_limit)
644 0 0 if ($returncode != 100)
654 35 0 unless ($fail)
656 0 35 if ($returncode != 100)
662 0 35 if (my $error = $@)
670 35 0 unless ($fail)
672 1 34 if ($returncode != 100)
679 34 1 if (not $fail) { }
1 0 elsif (my $reject_reason = $handler->get_reject_mail) { }
0 0 elsif (my $defer_reason = $handler->get_defer_mail) { }
681 0 34 if ($temp_file) { }
688 34 0 if ($self->smtp_forward_to_destination) { }
690 2 32 if (my $reject_reason = $handler->get_quarantine_mail) { }
700 0 34 if ($smtp->{'using_lmtp'}) { }
713 0 0 if ($upstream_error =~ /^4\d\d /) { }
0 0 elsif ($upstream_error =~ /^5\d\d /) { }
726 0 0 if ($smtp->{'using_lmtp'}) { }
739 0 1 if ($smtp->{'using_lmtp'}) { }
753 0 0 if ($smtp->{'using_lmtp'}) { }
766 0 0 if ($smtp->{'using_lmtp'}) { }
845 5 29 if ($sock)
846 0 5 unless ($sock->connected)
852 29 5 unless ($sock)
856 0 29 if ($smtp_conf->{'sock_type'} eq 'inet') { }
29 0 elsif ($smtp_conf->{'sock_type'} eq 'unix') { }
873 0 29 unless ($sock)
880 0 29 if (my $error = $@)
886 0 29 if (!$line =~ /250/)
896 29 5 if ($new_sock) { }
897 0 29 unless $self->send_smtp_packet($sock, 'EHLO ' . $smtp->{'server_name'}, '250')
900 0 5 unless $self->send_smtp_packet($sock, 'RSET', '250')
903 34 0 if ($smtp->{'fwd_helo_host'})
904 0 34 unless $self->send_smtp_packet($sock, 'XFORWARD HELO=' . $smtp->{'fwd_helo_host'}, '250')
906 34 0 if ($smtp->{'fwd_connect_ip'})
907 0 34 unless $self->send_smtp_packet($sock, 'XFORWARD ADDR=' . $smtp->{'fwd_connect_ip'}, '250')
909 34 0 if ($smtp->{'fwd_connect_host'})
910 0 34 unless $self->send_smtp_packet($sock, 'XFORWARD NAME=' . $smtp->{'fwd_connect_host'}, '250')
912 0 34 if ($smtp->{'fwd_ident'})
913 0 0 unless $self->send_smtp_packet($sock, 'XFORWARD IDENT=' . $smtp->{'fwd_ident'}, '250')
916 0 34 unless $self->send_smtp_packet($sock, 'MAIL FROM:' . $smtp->{'mail_from'}, '250')
918 0 34 unless $self->send_smtp_packet($sock, 'RCPT TO:' . $rcpt_to, '250')
922 0 34 unless $self->send_smtp_packet($sock, 'DATA', '354')
932 0 34 if ($spool) { }
959 0 34 unless $self->send_smtp_packet($sock, '.', '250')
970 1 29 unless $sock
971 0 29 unless $self->send_smtp_packet($sock, 'QUIT', '221')
983 34 267 if $status eq '.'
1002 0 301 if (my $error = $@)
1014 301 0 if ($recv =~ /^$expect/) { }
1041 13 35 if (substr(lc $header_v, 0, length($header) + 1) eq lc "${header}:")
1043 6 7 if ($search_i == $index)
1051 6 0 if ($result_i)
1052 6 0 if ($value eq '') { }