### CMail::In::pop3s
# module for checking for messages in pop3 mailboxes over SSL
package CMail::In::pop3s;
use strict;
BEGIN {
use CMail::In::pop3;
use vars qw($VERSION @ISA);
$VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
@ISA = qw( CMail::In::pop3 );
}
use IO::Socket::SSL 0.91;
# internal methods
# connect($host,$port) - opens a socket to the given host and port and
# returns it. If someone wants to implement SSL, I suggest overloading
# just this function, if that's all that's required.
sub connect {
my $self = shift;
my $host = shift;
my $port = shift || '995';
my $socket = IO::Socket::SSL->new(
PeerAddr => $host,
PeerPort => $port,
Proto => 'tcp',
);
if ( not defined $socket ) {
die "pop3s: couldn't open socket to $host:$port: $!\n";
}
return $socket;
}
1;
syntax highlighted by Code2HTML, v. 0.9.1