line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1001
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
93
|
|
3
|
|
|
|
|
|
|
package Email::Folder::POP3; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Email::Folder::POP3::VERSION = '1.015'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: Email::Folder Access to POP3 Folders |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $POP3 ||= 'Net::POP3'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
753
|
use parent qw[Email::Folder::Reader]; |
|
1
|
|
|
|
|
341
|
|
|
1
|
|
|
|
|
8
|
|
12
|
1
|
|
|
1
|
|
2058
|
use Net::POP3; |
|
1
|
|
|
|
|
38829
|
|
|
1
|
|
|
|
|
52
|
|
13
|
1
|
|
|
1
|
|
916
|
use URI; |
|
1
|
|
|
|
|
4310
|
|
|
1
|
|
|
|
|
302
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _uri { |
16
|
0
|
|
|
0
|
|
|
my $self = shift; |
17
|
0
|
|
0
|
|
|
|
return $self->{_uri} ||= URI->new($self->{_file}); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _server { |
21
|
0
|
|
|
0
|
|
|
my $self = shift; |
22
|
0
|
0
|
|
|
|
|
return $self->{_server} if $self->{_server}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $uri = $self->_uri; |
25
|
0
|
|
|
|
|
|
my $host = $uri->host; |
26
|
0
|
|
0
|
|
|
|
my $port = $uri->port || 110; |
27
|
0
|
0
|
|
|
|
|
my $server = $POP3->new($host, Port => $port, Timeout => 60) |
28
|
|
|
|
|
|
|
or die("Net::POP3->new('$host', Port => $port, Timeout => 60): $!"); |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my ($user, $pass) = @{$self}{qw[username password]}; |
|
0
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
($user, $pass) = split ':', $uri->userinfo, 2 unless $user; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
$server->login($user, $pass) if $user; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$self->{_next} = 1; |
36
|
0
|
|
|
|
|
|
return $self->{_server} = $server; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub next_message { |
40
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
41
|
0
|
|
|
|
|
|
my $message = $self->_server->get($self->{_next}); |
42
|
0
|
0
|
|
|
|
|
if ( $message ) { |
43
|
0
|
|
|
|
|
|
++$self->{_next}; |
44
|
0
|
|
|
|
|
|
return join '', @{$message}; |
|
0
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
|
$self->{_next} = 1; |
47
|
0
|
|
|
|
|
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |