1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/W/learn/imapclient3xx_ssl
Nick Bebout c08a56e486 1.504
2012-09-02 19:08:57 -05:00

31 lines
634 B
Perl
Executable File

#!/usr/bin/perl -w
use Mail::IMAPClient;
use IO::Socket::SSL;
$ARGV[3] or die "usage: $0 host user password folder\n";
$host = $ARGV[0];
$user = $ARGV[1];
$password = $ARGV[2];
$folder = $ARGV[3];
my $imap = Mail::IMAPClient->new();
my $ssl = IO::Socket::SSL->new(
Proto => 'tcp',
PeerAddr => $host,
PeerPort => 993, # IMAP over SSL standard port
);
$imap->Debug(1);
#$imap->Server($host);
$imap->Socket($ssl);
#$imap->connect() or die;
$imap->User($user);
$imap->Password($password);
$imap->login() or die;
$imap->Uid(1);
$imap->Peek(1);
$imap->select($folder) or die;
$imap->close();