Net::POP3 with SSL

A

Avi Kak

Hello:

Is there a version of the Net::pOP3 module that works with SSL but
has essentially the same interface?

Any help would be much appreciated. Thanks.

Avi Kak ([email protected])
 
M

Michael Kebe

Avi said:
Is there a version of the Net::pOP3 module that works with SSL but
has essentially the same interface?

I found a Mail::pOP3Client at search.cpan.org. Looks like it supports SSL.

Michael
 
Z

zentara

Is there a version of the Net::pOP3 module that works with SSL but
has essentially the same interface?

Any help would be much appreciated. Thanks.

Hi, here is an untested script from origins unknown.

#!/usr/bin/perl
use Mail::pOP3Client;

$pop = new Mail::pOP3Client( USER => "me",
PASSWORD => "mypassword",
HOST => "pop3.do.main" );
for( $i = 1; $i <= $pop->Count(); $i++ ) {
foreach( $pop->Head( $i ) ) {
/^(From|Subject):\s+/i && print $_, "\n";
}
}
$pop->Close();

# OR with SSL
##**<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$pop = new Mail::pOP3Client( USER => "me",
PASSWORD => "mypassword",
HOST => "pop3.do.main",
USESSL => true,
);

# OR
$pop2 = new Mail::pOP3Client( HOST => "pop3.otherdo.main" );
$pop2->User( "somebody" );
$pop2->Pass( "doublesecret" );
$pop2->Connect() >= 0 || die $pop2->Message();
$pop2->Close();

# OR to use your own SSL socket...
my $socket = IO::Socket::SSL->new( PeerAddr => 'pop.securedo.main',
PeerPort => 993,
Proto => 'tcp') || die "No
socket!";
my $pop = Mail::pOP3Client->new();
$pop->User('somebody');
$pop->Pass('doublesecret');
$pop->Socket($socket);
$pop->Connect();

__END__
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,079
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top