Mail-Box-POP3
view release on metacpan or search on metacpan
lib/Mail/Transport/POP3.pm view on Meta::CPAN
our $VERSION = '3.007';
}
use base 'Mail::Transport::Receive';
use strict;
use warnings;
use IO::Socket ();
use IO::Socket::IP ();
use IO::Socket::SSL qw(SSL_VERIFY_NONE);
use Socket qw/$CRLF/;
use Digest::MD5 qw/md5_hex/;
use MIME::Base64 qw/encode_base64/;
sub _OK($) { substr(shift // '', 0, 3) eq '+OK' }
sub init($)
{ my ($self, $args) = @_;
$args->{via} = 'pop3';
lib/Mail/Transport/POP3.pm view on Meta::CPAN
my ($host, $port, $username, $password) = $self->remoteHost;
unless($username && $password)
{ $self->log(ERROR => "POP3 requires a username and password.");
return;
}
my $socket;
if($self->useSSL)
{ my $opts = $self->SSLOptions;
$socket = eval { IO::Socket::SSL->new(PeerAddr => "$host:$port", %$opts) };
}
else
{ $socket = eval { IO::Socket::IP->new("$host:$port") };
}
unless($socket)
{ $self->log(ERROR => "Cannot connect to $host:$port for POP3: $!");
return;
}
lib/Mail/Transport/POP3.pod view on Meta::CPAN
=item proxy => PATH
=item retry => NUMBER|undef
=item ssl_options => HASH
Unless overruled, C<verify_hostname> will be set to false and
C<SSL_verify_mode> to C<SSL_VERIFY_NONE}>
You can also set the SSL parameters via IO::Socket::SSL subroutine set_defaults.
Connections will get restarted when they are lost: you have to keep the
defaults in place during POP actions.
=item timeout => SECONDS
=item trace => LEVEL
=item use_ssl => BOOLEAN
=item username => STRING
( run in 0.500 second using v1.01-cache-2.11-cpan-4d50c553e7e )