| 1 | # Net::POP3.pm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # Copyright (C) 1995-2004 Graham Barr. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This module is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # the same terms as Perl itself, i.e. under the terms of either the GNU General | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # Public License or the Artistic License, as specified in the F<LICENCE> file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | package Net::POP3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use 5.008001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 5 | ▶ | use IO::Socket; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | use Net::Cmd; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | use Net::Config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | our $VERSION = "3.16"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # Code for detecting if we can use SSL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 5 | ▶ | my $ssl_class = eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
eval {
do {
require IO::Socket::SSL;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::SSL'->VERSION(2.007)
}
} && 'IO::Socket::SSL'
MC/DC0%0/1
eval {
do {
require IO::Socket::SSL;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::SSL'->VERSION(2.007)
}
} && 'IO::Socket::SSL'
eval {
do {
require IO::Socket::SSL;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::SSL'->VERSION(2.007)
}
}
Truth table50%1/2
A
A= eval {
do {
require IO::Socket::SSL;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::SSL'->VERSION(2.007)
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 5 | require IO::Socket::SSL; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # first version with default CA on most platforms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | ▶ | no warnings 'numeric'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 5 | IO::Socket::SSL->VERSION(2.007); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } && 'IO::Socket::SSL'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 5 | ▶ | my $nossl_warn = !$ssl_class && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
!$ssl_class && 'To use SSL please install IO::Socket::SSL with version>=2.007'
MC/DC0%0/1
!$ssl_class && 'To use SSL please install IO::Socket::SSL with version>=2.007'
!$ssl_class
Truth table50%1/2
not(A)
A= !$ssl_class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 'To use SSL please install IO::Socket::SSL with version>=2.007'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | # Code for detecting if we can use IPv6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 5 | my $family_key = 'Domain'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | my $inet6_class = eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 5 | require IO::Socket::IP; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 5 | ▶ | no warnings 'numeric'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 5 | ▶ | IO::Socket::IP->VERSION(0.25) || die; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 5 | ▶ | $family_key = 'Family'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
eval {
do {
use warnings;
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::INET6"->VERSION("2.62")
}
} and "IO::Socket::INET6"
MC/DC0%0/1
eval {
do {
use warnings;
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::INET6"->VERSION("2.62")
}
} and "IO::Socket::INET6"
eval {
do {
use warnings;
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::INET6"->VERSION("2.62")
}
}
Truth table0%0/2
A
A= eval {
do {
use warnings;
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::INET6"->VERSION("2.62")
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 5 | ▶ | } && 'IO::Socket::IP' || eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
eval {
do {
require IO::Socket::IP;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::IP'->VERSION(0.25) or die;
$family_key = 'Family'
}
} && 'IO::Socket::IP' || eval {
do {
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::INET6'->VERSION(2.62)
}
} && 'IO::Socket::INET6'
eval {
do {
require IO::Socket::IP;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::IP"->VERSION("0.25") or die;
$family_key = "Family"
}
} and "IO::Socket::IP"
MC/DC0%0/2
eval {
do {
require IO::Socket::IP;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::IP'->VERSION(0.25) or die;
$family_key = 'Family'
}
} && 'IO::Socket::IP' || eval {
do {
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::INET6'->VERSION(2.62)
}
} && 'IO::Socket::INET6'
eval {
do {
require IO::Socket::IP;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::IP"->VERSION("0.25") or die;
$family_key = "Family"
}
}
eval {
do {
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::INET6'->VERSION(2.62)
}
} && 'IO::Socket::INET6'
Truth table33%1/3
A || B
A= eval {
do {
require IO::Socket::IP;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
"IO::Socket::IP"->VERSION("0.25") or die;
$family_key = "Family"
}
}B= eval {
do {
require IO::Socket::INET6;
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
'IO::Socket::INET6'->VERSION(2.62)
}
} && 'IO::Socket::INET6'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | require IO::Socket::INET6; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 5 | ▶ | no warnings 'numeric'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | IO::Socket::INET6->VERSION(2.62); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } && 'IO::Socket::INET6'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 3 | ▶ | sub can_ssl { $ssl_class }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_ssl: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | ▶ | sub can_inet6 { $inet6_class }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_inet6: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 5 | ▶ | our @ISA = ('Net::Cmd', $inet6_class || 'IO::Socket::INET'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$inet6_class || 'IO::Socket::INET'
MC/DC0%0/1
$inet6_class || 'IO::Socket::INET'
$inet6_class
Truth table50%1/2
A
A= $inet6_class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 3 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=18 SCAR=32.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 3 | ▶ | my $type = ref($self) || $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table33%1/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 3 | my ($host, %arg); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 3 | ▶ | if (@_ % 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 3 | $host = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 3 | %arg = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | %arg = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | $host = delete $arg{Host}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 3 | ▶ | my $hosts = defined $host ? [$host] : $NetConfig{pop3_hosts}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 3 | my $obj; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 3 | ▶ | if ($arg{SSL}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # SSL from start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 2 | ▶ | die $nossl_warn if !$ssl_class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 2 | ▶ | $arg{Port} ||= 995; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$arg{"Port"} ||= 995
MC/DC0%0/1
$arg{"Port"} ||= 995
$arg{"Port"}
Truth table50%1/2
A
A= $arg{"Port"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 3 | ▶ | $arg{Timeout} = 120 if ! defined $arg{Timeout}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 3 | foreach my $h (@{$hosts}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | $obj = $type->SUPER::new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | PeerAddr => ($host = $h), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | PeerPort => $arg{Port} || 'pop3(110)', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | Proto => 'tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | $family_key => $arg{Domain} || $arg{Family}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | LocalAddr => $arg{LocalAddr}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | LocalPort => exists($arg{ResvPort}) ? $arg{ResvPort} : $arg{LocalPort}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | Timeout => $arg{Timeout}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 3 | ▶ | and last; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition60%3/5
$arg{'Port'} || 'pop3(110)'
$arg{'Domain'} || $arg{'Family'}
MC/DC100%1/1
$arg{'Port'} || 'pop3(110)'
$arg{'Port'}
MC/DC0%0/2
$arg{'Domain'} || $arg{'Family'}
$arg{'Domain'}
$arg{'Family'}
Truth table100%2/2
A
A= $arg{'Port'}
Truth table33%1/3
A || B
A= $arg{'Domain'}B= $arg{'Family'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 3 | ▶ | unless defined $obj; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 3 | ${*$obj}{'net_pop3_arg'} = \%arg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 3 | ${*$obj}{'net_pop3_host'} = $host; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 3 | ▶ | if ($arg{SSL}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 2 | ▶ | Net::POP3::_SSL->start_SSL($obj,%arg) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 3 | $obj->autoflush(1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 3 | ▶ | $obj->debug(exists $arg{Debug} ? $arg{Debug} : undef); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 3 | ▶ | unless ($obj->response() == CMD_OK) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $obj->close(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 3 | ${*$obj}{'net_pop3_banner'} = $obj->message; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 3 | $obj; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | sub host { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
host: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ${*$me}{'net_pop3_host'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | ## We don't want people sending me their passwords when they report problems | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | ## now do we :-) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | sub debug_text { $_[2] =~ /^(pass|rpop)/i ? "$1 ....\n" : $_[2]; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug_text: not called CC=2 SCAR=17.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub login { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
login: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->login([$user[, $pass]])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ >= 1 and @_ <= 3
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1
@_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | my ($me, $user, $pass) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if (@_ <= 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ($user, $pass) = $me->_lookup_credentials($user); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | $me->user($user) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | and $me->pass($pass); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | sub starttls { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
starttls: called CC=4 SCAR=14.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | ▶ | $ssl_class or die $nossl_warn; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 1 | ▶ | $self->_STLS or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | Net::POP3::_SSL->start_SSL($self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 1 | ▶ | %{ ${*$self}{'net_pop3_arg'} }, # (ssl) args given in new | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | @_ # more (ssl) args | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | ) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | sub apop { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
apop: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->apop([$user[, $pass]])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ >= 1 and @_ <= 3
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1
@_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | my ($me, $user, $pass) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | my $banner; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | my $md; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if (eval { local $SIG{__DIE__}; require Digest::MD5 }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | $md = Digest::MD5->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | elsif (eval { local $SIG{__DIE__}; require MD5 }) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $md = MD5->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | carp "You need to install Digest::MD5 or MD5 to use the APOP command"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | unless ($banner = (${*$me}{'net_pop3_banner'} =~ /(<.*>)/)[0]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if (@_ <= 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ($user, $pass) = $me->_lookup_credentials($user); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | $md->add($banner, $pass); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | unless ($me->_APOP($user, $md->hexdigest)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $me->_get_mailbox_count(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | sub user { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
user: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | ▶ | @_ == 2 or croak 'usage: $pop3->user($user)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | $_[0]->_USER($_[1]) ? 1 : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | sub pass { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pass: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | @_ == 2 or croak 'usage: $pop3->pass($pass)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my ($me, $pass) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | unless ($me->_PASS($pass)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $me->_get_mailbox_count(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub reset { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reset: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | @_ == 1 or croak 'usage: $obj->reset()'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | unless ($me->_RSET); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | if (defined ${*$me}{'net_pop3_mail'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | local $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | foreach (@{${*$me}{'net_pop3_mail'}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | delete $_->{'net_pop3_deleted'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | sub last { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
last: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | @_ == 1 or croak 'usage: $obj->last()'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | unless $_[0]->_LAST && $_[0]->message =~ /(\d+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0]->_LAST and $_[0]->message =~ /(\d+)/
MC/DC0%0/2
$_[0]->_LAST and $_[0]->message =~ /(\d+)/
$_[0]->_LAST
$_[0]->message =~ /(\d+)/
Truth table0%0/3
A and B
A= $_[0]->_LASTB= $_[0]->message =~ /(\d+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | return $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | sub top { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
top: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | @_ == 2 || @_ == 3 or croak 'usage: $pop3->top($msgnum[, $numlines])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 2 or @_ == 3
MC/DC0%0/2
@_ == 2 or @_ == 3
@_ == 2
@_ == 3
Truth table0%0/3
A or B
A= @_ == 2B= @_ == 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | unless $me->_TOP($_[0], $_[1] || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$_[1] || 0
MC/DC0%0/1
$_[1] || 0
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | $me->read_until_dot; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | sub popstat { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
popstat: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | @_ == 1 or croak 'usage: $pop3->popstat()'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | return () | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | ▶ | unless $me->_STAT && $me->message =~ /(\d+)\D+(\d+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$me->_STAT and $me->message =~ /(\d+)\D+(\d+)/
MC/DC0%0/2
$me->_STAT and $me->message =~ /(\d+)\D+(\d+)/
$me->_STAT
$me->message =~ /(\d+)\D+(\d+)/
Truth table0%0/3
A and B
A= $me->_STATB= $me->message =~ /(\d+)\D+(\d+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | ($1 || 0, $2 || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | sub list { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
list: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | @_ == 1 || @_ == 2 or croak 'usage: $pop3->list([$msgnum])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 1 or @_ == 2
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1
@_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | unless $me->_LIST(@_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | $me->message =~ /\d+\D+(\d+)/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | return $1 || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$1 || undef
MC/DC0%0/1
$1 || undef
$1
Truth table0%0/2
A
A= $1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | my $info = $me->read_until_dot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my %hash = map { (/(\d+)\D+(\d+)/) } @$info; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | return \%hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | @_ == 2 or @_ == 3 or croak 'usage: $pop3->get($msgnum[, $fh])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 2 or @_ == 3
MC/DC0%0/2
@_ == 2 or @_ == 3
@_ == 2
@_ == 3
Truth table0%0/3
A or B
A= @_ == 2B= @_ == 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | unless $me->_RETR(shift); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $me->read_until_dot(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | sub getfh { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getfh: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | @_ == 2 or croak 'usage: $pop3->getfh($msgnum)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | ▶ | return unless $me->_RETR(shift); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | return $me->tied_fh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | sub delete { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | ▶ | @_ == 2 or croak 'usage: $pop3->delete($msgnum)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | ▶ | return 0 unless $me->_DELE(@_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ${*$me}{'net_pop3_deleted'} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | sub uidl { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
uidl: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | @_ == 1 || @_ == 2 or croak 'usage: $pop3->uidl([$msgnum])'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 1 or @_ == 2
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1
@_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | my $uidl; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | ▶ | $me->_UIDL(@_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | $uidl = ($me->message =~ /\d+\s+([\041-\176]+)/)[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | my $ref = $me->read_until_dot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | $uidl = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | foreach my $ln (@$ref) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my ($msg, $uid) = $ln =~ /^\s*(\d+)\s+([\041-\176]+)/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | $uidl->{$msg} = $uid; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | return $uidl; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | ▶ | sub ping { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ping: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | ▶ | @_ == 2 or croak 'usage: $pop3->ping($user)'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | return () unless $me->_PING(@_) && $me->message =~ /(\d+)\D+(\d+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$me->_PING(@_) and $me->message =~ /(\d+)\D+(\d+)/
MC/DC0%0/2
$me->_PING(@_) and $me->message =~ /(\d+)\D+(\d+)/
$me->_PING(@_)
$me->message =~ /(\d+)\D+(\d+)/
Truth table0%0/3
A and B
A= $me->_PING(@_)B= $me->message =~ /(\d+)\D+(\d+)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | ($1 || 0, $2 || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | ▶ | sub _lookup_credentials { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_lookup_credentials: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | my ($me, $user) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | require Net::Netrc; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | $user ||= eval { local $SIG{__DIE__}; (getpwuid($>))[0] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | || $ENV{NAME} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | || $ENV{USER} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | || $ENV{LOGNAME}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/12
$user ||= eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
} || $ENV{"NAME"} || $ENV{"USER"} || $ENV{"LOGNAME"}
eval {
do {
local $SIG{'__DIE__'};
(getpwuid $>)[0]
}
} || $ENV{'NAME'} || $ENV{'USER'} || $ENV{'LOGNAME'}
eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
} or $ENV{"NAME"} or $ENV{"USER"}
eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
} or $ENV{"NAME"}
MC/DC0%0/5
$user ||= eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
} || $ENV{"NAME"} || $ENV{"USER"} || $ENV{"LOGNAME"}
$user
eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
}
$ENV{"NAME"}
$ENV{"USER"}
$ENV{'LOGNAME'}
Truth table0%0/6
A ||= B or C or D || E
A= $userB= eval {
do {
local $SIG{"__DIE__"};
(getpwuid $>)[0]
}
}C= $ENV{"NAME"}D= $ENV{"USER"}E= $ENV{'LOGNAME'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | my $m = Net::Netrc->lookup(${*$me}{'net_pop3_host'}, $user); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | $m ||= Net::Netrc->lookup(${*$me}{'net_pop3_host'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$m ||= "Net::Netrc"->lookup(do {
*$me
}->{"net_pop3_host"})
MC/DC0%0/2
$m ||= "Net::Netrc"->lookup(do {
*$me
}->{"net_pop3_host"})
$m
"Net::Netrc"->lookup(do {
*$me
}->{"net_pop3_host"})
Truth table0%0/3
A ||= B
A= $mB= "Net::Netrc"->lookup(do {
*$me
}->{"net_pop3_host"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | my $pass = $m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$m->password or ""
MC/DC0%0/1
$m->password or ""
$m->password
Truth table0%0/2
A
A= $m->password
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | ? $m->password || "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ($user, $pass); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | ▶ | sub _get_mailbox_count { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_mailbox_count: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | my ($me) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | ▶ | my $ret = ${*$me}{'net_pop3_count'} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | ($me->message =~ /(\d+)\s+message/io) ? $1 : ($me->popstat)[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | ▶ | $ret ? $ret : "0E0"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | ▶ | sub _STAT { shift->command('STAT' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_STAT: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | ▶ | sub _LIST { shift->command('LIST', @_)->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_LIST: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | ▶ | sub _RETR { shift->command('RETR', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_RETR: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | sub _DELE { shift->command('DELE', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_DELE: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | ▶ | sub _NOOP { shift->command('NOOP' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_NOOP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | sub _RSET { shift->command('RSET' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_RSET: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 3 | ▶ | sub _QUIT { shift->command('QUIT' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_QUIT: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | sub _TOP { shift->command( 'TOP', @_)->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_TOP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | ▶ | sub _UIDL { shift->command('UIDL', @_)->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_UIDL: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | ▶ | sub _USER { shift->command('USER', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_USER: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | sub _PASS { shift->command('PASS', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_PASS: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | ▶ | sub _APOP { shift->command('APOP', @_)->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_APOP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | ▶ | sub _PING { shift->command('PING', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_PING: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | ▶ | sub _RPOP { shift->command('RPOP', $_[0])->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_RPOP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | ▶ | sub _LAST { shift->command('LAST' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_LAST: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 0 | ▶ | sub _CAPA { shift->command('CAPA' )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_CAPA: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 1 | ▶ | sub _STLS { shift->command("STLS", )->response() == CMD_OK } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_STLS: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 3 | ▶ | sub quit { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
quit: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 3 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 3 | $me->_QUIT; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 3 | $me->close; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 0 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | if (defined fileno($me) and ${*$me}{'net_pop3_deleted'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined fileno $me and do {
*$me
}->{"net_pop3_deleted"}
MC/DC0%0/2
defined fileno $me and do {
*$me
}->{"net_pop3_deleted"}
defined fileno $me
do {
*$me
}->{"net_pop3_deleted"}
Truth table0%0/3
A and B
A= defined fileno $meB= do {
*$me
}->{"net_pop3_deleted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | $me->reset; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | $me->quit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | ## POP3 has weird responses, so we emulate them to look the same :-) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 7 | ▶ | sub response { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
response: called CC=5 SCAR=17.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 7 | my $cmd = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 7 | ▶ | my $str = $cmd->getline() or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 7 | my $code = "500"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 7 | ▶ | $cmd->debug_print(0, $str) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | if ($cmd->debug); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 7 | ▶ | if ($str =~ s/^\+OK\s*//io) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 7 | $code = "200"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | elsif ($str =~ s/^\+\s*//io) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | $code = "300"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | $str =~ s/^-ERR\s*//io; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 7 | ${*$cmd}{'net_cmd_resp'} = [$str]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 7 | ${*$cmd}{'net_cmd_code'} = $code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 7 | substr($code, 0, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | sub capa { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
capa: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | 0 | my ($capa, %capabilities); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | # Fake a capability here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | ▶ | $capabilities{APOP} = '' if ($this->banner() =~ /<.*>/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 0 | ▶ | if ($this->_CAPA()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 0 | $capabilities{CAPA} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | $capa = $this->read_until_dot(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | %capabilities = (%capabilities, map {/^\s*(\S+)\s*(.*)/} @$capa); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | # Check AUTH for SASL capabilities | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | ▶ | if ($this->command('AUTH')->response() == CMD_OK) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | my $mechanism = $this->read_until_dot(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | $capabilities{SASL} = join " ", map {m/([A-Z0-9_-]+)/} @{$mechanism}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 0 | return ${*$this}{'net_pop3e_capabilities'} = \%capabilities; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | ▶ | sub capabilities { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
capabilities: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 0 | ▶ | ${*$this}{'net_pop3e_capabilities'} || $this->capa; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | ▶ | sub auth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
auth: not called CC=16 SCAR=56.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | my ($self, $username, $password) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | require MIME::Base64; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | require Authen::SASL; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | } or $self->set_status(500, ["Need MIME::Base64 and Authen::SASL todo auth"]), return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | my $capa = $self->capa; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | ▶ | my $mechanisms = $capa->{SASL} || 'CRAM-MD5'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$capa->{'SASL'} || 'CRAM-MD5'
MC/DC0%0/1
$capa->{'SASL'} || 'CRAM-MD5'
$capa->{'SASL'}
Truth table0%0/2
A
A= $capa->{'SASL'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | my $sasl; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | ▶ | if (ref($username) and UNIVERSAL::isa($username, 'Authen::SASL')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $username and UNIVERSAL::isa($username, "Authen::SASL")
MC/DC0%0/2
ref $username and UNIVERSAL::isa($username, "Authen::SASL")
ref $username
UNIVERSAL::isa($username, "Authen::SASL")
Truth table0%0/3
A and B
A= ref $usernameB= UNIVERSAL::isa($username, "Authen::SASL")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | $sasl = $username; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | my $user_mech = $sasl->mechanism || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$sasl->mechanism || ''
MC/DC0%0/1
$sasl->mechanism || ''
$sasl->mechanism
Truth table0%0/2
A
A= $sasl->mechanism
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | my @user_mech = split(/\s+/, $user_mech); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | my %user_mech; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | @user_mech{@user_mech} = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | my @server_mech = split(/\s+/, $mechanisms); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | my @mech = @user_mech | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 0 | ▶ | ? grep { exists $user_mech{$_} } @server_mech | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | : @server_mech; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 0 | ▶ | unless (@mech) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 0 | $self->set_status( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 500, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | [ 'Client SASL mechanisms (', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | join(', ', @user_mech), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | ') do not match the SASL mechnism the server announces (', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | join(', ', @server_mech), ')', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 0 | $sasl->mechanism(join(" ", @mech)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 0 | ▶ | die "auth(username, password)" if not length $username; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | $sasl = Authen::SASL->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | mechanism => $mechanisms, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | callback => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | user => $username, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | pass => $password, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | authname => $username, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | # We should probably allow the user to pass the host, but I don't | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | # currently know and SASL mechanisms that are used by smtp that need it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 0 | my ($hostname) = split /:/, ${*$self}{'net_pop3_host'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | my $client = eval { $sasl->client_new('pop', $hostname, 0) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | ▶ | unless ($client) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | my $mech = $sasl->mechanism; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | $self->set_status( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 500, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | [ " Authen::SASL failure: $@", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | '(please check if your local Authen::SASL installation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | "supports mechanism '$mech'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | my ($token) = $client->client_start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | ▶ | or do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 0 | my $mech = $client->mechanism; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | $self->set_status( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 500, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | [ ' Authen::SASL failure: $client->client_start ', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | "mechanism '$mech' hostname #$hostname#", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | $client->error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | # We don't support sasl mechanisms that encrypt the socket traffic. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | # todo that we would really need to change the ISA hierarchy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | # so we don't inherit from IO::Socket, but instead hold it in an attribute | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | my @cmd = ("AUTH", $client->mechanism); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 0 | my $code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | 0 | ▶ | push @cmd, MIME::Base64::encode_base64($token, '') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $token and length $token
MC/DC0%0/2
defined $token and length $token
defined $token
length $token
Truth table0%0/3
A and B
A= defined $tokenB= length $token
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | if defined $token and length $token; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | ▶ | while (($code = $self->command(@cmd)->response()) == CMD_MORE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 0 | ▶ | my ($token) = $client->client_step(MIME::Base64::decode_base64(($self->message)[0])) or do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | $self->set_status( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 500, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | [ ' Authen::SASL failure: $client->client_step ', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | "mechanism '", $client->mechanism, " hostname #$hostname#, ", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | $client->error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | ▶ | @cmd = (MIME::Base64::encode_base64(defined $token ? $token : '', '')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | $code == CMD_OK; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 0 | ▶ | sub banner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
banner: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 0 | return ${*$this}{'net_pop3_banner'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | package Net::POP3::_SSL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 5 | ▶ | our @ISA = ( $ssl_class ? ($ssl_class):(), 'Net::POP3' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | ▶ | sub starttls { die "POP3 connection is already in SSL mode" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
starttls: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 3 | ▶ | sub start_SSL { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_SSL: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 3 | my ($class,$pop3,%arg) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 3 | delete @arg{ grep { !m{^SSL_} } keys %arg }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 3 | ▶ | ( $arg{SSL_verifycn_name} ||= $pop3->host ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$arg{"SSL_verifycn_name"} ||= $pop3->host
MC/DC0%0/2
$arg{"SSL_verifycn_name"} ||= $pop3->host
$arg{"SSL_verifycn_name"}
$pop3->host
Truth table33%1/3
A ||= B
A= $arg{"SSL_verifycn_name"}B= $pop3->host
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | =~s{(?<!:):[\w()]+$}{}; # strip port | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | $arg{SSL_hostname} = $arg{SSL_verifycn_name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 3 | ▶ | if ! defined $arg{SSL_hostname} && $class->can_client_sni; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $arg{"SSL_hostname"} and $class->can_client_sni
MC/DC0%0/2
not defined $arg{"SSL_hostname"} and $class->can_client_sni
not defined $arg{"SSL_hostname"}
$class->can_client_sni
Truth table33%1/3
not(A) and B
A= not defined $arg{"SSL_hostname"}B= $class->can_client_sni
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 3 | ▶ | $arg{SSL_verifycn_scheme} ||= 'pop3'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$arg{"SSL_verifycn_scheme"} ||= "pop3"
MC/DC0%0/1
$arg{"SSL_verifycn_scheme"} ||= "pop3"
$arg{"SSL_verifycn_scheme"}
Truth table50%1/2
A
A= $arg{"SSL_verifycn_scheme"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 3 | my $ok = $class->SUPER::start_SSL($pop3,%arg); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 3 | ▶ | $@ = $ssl_class->errstr if !$ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 3 | return $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||