Branch Coverage

blib/lib/Net/SMTP.pm
Criterion Covered Total %
branch 24 180 13.3


line true false branch
57 3 0 if (@_ % 2) { }
66 2 1 if ($arg{'SSL'})
68 0 2 unless $ssl_class
72 3 0 defined $host ? :
75 3 0 unless defined $arg{'Timeout'}
77 0 3 ref $hosts ? :
87 3 0 if $obj = $type->SUPER::new("PeerAddr", $host = $h, "PeerPort", $arg{'Port'} || 'smtp(25)', "LocalAddr", $arg{'LocalAddr'}, "LocalPort", $arg{'LocalPort'}, $family_key, $arg{'Domain'} || $arg{'Family'}, "Proto", "tcp", "Timeout", $arg{'Timeout'})
91 0 3 unless defined $obj
96 2 1 if ($arg{'SSL'})
97 0 2 unless "Net::SMTP::_SSL"->start_SSL($obj, %arg)
103 3 0 exists $arg{'Debug'} ? :
105 0 3 unless ($obj->response == 2)
117 3 0 if (not exists $arg{'SendHello'} or $arg{'SendHello'})
118 0 3 unless ($obj->hello($arg{'Hello'} || ''))
156 0 0 if defined $self->supports("ETRN", 500, ["Command unknown: 'ETRN'"])
164 0 0 unless eval { do { require MIME::Base64; require Authen::SASL } }
170 0 0 unless defined $mechanisms
174 0 0 if (ref $username and UNIVERSAL::isa($username, 'Authen::SASL')) { }
177 0 0 if (not defined $requested_mechanisms or $requested_mechanisms eq "")
182 0 0 unless length $username
197 0 0 if ($client)
200 0 0 unless defined $failed_mechanism
201 0 0 if $self->debug
204 0 0 unless $mechanisms =~ /\S/
222 0 0 if defined $str and length $str
227 0 0 if $self->debug
234 0 0 if $self->debug
247 4 0 if ($ok) { }
0 0 elsif ($me->status == 5) { }
250 9 0 if $ln =~ /([-\w]+)\b[= \t]*([^\n]*)/
255 0 0 if $ok = $me->_HELO($domain)
259 0 4 unless $ok
268 0 1 unless $ssl_class
269 0 1 unless $self->_STARTTLS
271 0 1 unless "Net::SMTP::_SSL"->start_SSL($self, %{${*$self;}{"net_smtp_arg"};}, @_)
284 0 0 if exists do { *$self }->{'net_smtp_esmtp'}{$cmd}
285 0 0 if @_
294 0 0 unless defined $addr
296 0 0 if (do { *$self }->{'net_smtp_exact_addr'}) { }
297 0 0 if $addr =~ /^\s*(<.*>)\s*$/s
300 0 0 if $addr =~ /(<[^>]*>)/
313 0 0 if (@_)
317 0 0 if (exists do { *$me }->{'net_smtp_esmtp'}) { }
320 0 0 if (defined($v = delete $opt{'Size'}))
321 0 0 if (exists $esmtp->{'SIZE'}) { }
329 0 0 if (defined($v = delete $opt{'Return'}))
330 0 0 if (exists $esmtp->{'DSN'}) { }
331 0 0 uc $v eq 'FULL' ? :
338 0 0 if (defined($v = delete $opt{'Bits'}))
339 0 0 if ($v eq '8') { }
0 0 elsif ($v eq 'binary') { }
0 0 elsif (exists $esmtp->{'8BITMIME'} or exists $esmtp->{'BINARYMIME'}) { }
340 0 0 if (exists $esmtp->{'8BITMIME'}) { }
348 0 0 if (exists $esmtp->{'BINARYMIME'} and exists $esmtp->{'CHUNKING'}) { }
364 0 0 if (defined($v = delete $opt{'Transaction'}))
365 0 0 if (exists $esmtp->{'CHECKPOINT'}) { }
373 0 0 if (defined($v = delete $opt{'Envelope'}))
374 0 0 if (exists $esmtp->{'DSN'}) { }
383 0 0 if (defined($v = delete $opt{'ENVID'}))
386 0 0 if (exists $esmtp->{'DSN'}) { }
394 0 0 if (defined($v = delete $opt{'AUTH'}))
398 0 0 if (exists $esmtp->{'AUTH'}) { }
399 0 0 if not defined $v or $v eq ""
407 0 0 if (defined($v = delete $opt{'XVERP'}))
408 0 0 if (exists $esmtp->{'XVERP'}) { }
416 0 0 if scalar keys %opt
437 0 0 if exists do { *$me }->{'net_smtp_lastch'}
448 0 0 if (@_ and ref $_[-1])
454 0 0 if (exists do { *$smtp }->{'net_smtp_esmtp'}) { }
0 0 elsif (%opt) { }
457 0 0 if (defined($v = delete $opt{'Notify'}))
458 0 0 if (exists $esmtp->{'DSN'}) { }
466 0 0 if (defined($v = delete $opt{'ORcpt'}))
467 0 0 if (exists $esmtp->{'DSN'}) { }
475 0 0 if scalar keys %opt
485 0 0 if ($smtp->_RCPT('TO:' . _addr($smtp, $addr) . $opts)) { }
0 0 elsif (not $skip_bad) { }
486 0 0 if $skip_bad
493 0 0 $skip_bad ? :
506 0 0 if (exists do { *$me }->{'net_smtp_chunking'}) { }
512 0 0 $ok && @_ ? :
522 0 0 if (exists do { *$me }->{'net_smtp_chunking'}) { }
525 0 0 if $me->_BDAT(length $data) and $me->rawdatasend($data)
538 0 0 if (exists do { *$me }->{'net_smtp_chunking'}) { }
541 0 0 if $me->_BDAT(length $data, "LAST") and $me->rawdatasend($data)
553 0 0 unless $me->_DATA
561 0 0 $me->_EXPN(@_) ? :
573 0 0 $me->_HELP(@_) ? :
628 3 0 if not defined $arg{'SSL_hostname'} and $class->can_client_sni
631 0 3 unless $ok