I’m using this script to get all the messages from a gmail account:
#!/usr/bin/perl
use Mail::POP3Client;
use IO::Socket::SSL;
no warnings;
my $username = 'username';
my $password = 'password';
my $mailhost = 'pop.gmail.com';
my $port = 995;
my $socket = IO::Socket::SSL->new(
PeerAddr => 'pop.gmail.com',
PeerPort => 995,
Proto => 'tcp',
)
or die "No socket!: $!\n";
my $pop = Mail::POP3Client->new();
$pop->User($username);
$pop->Pass($password);
$pop->Socket($socket);
$pop->Connect();
# me fijo cuantos hay
my $count = $pop->Count();
my $size = $pop->Size();
print "count[$count]\n";
In the gmail account there are about 1.500 messages… but always $pop->Count() return 250 or more.. never the 1.500.
Anyone knows something about this?
Thanks in advance.
Finally, i use IMAP insteand POP.
This work great.