#!/usr/bin/perl -w

use strict;
use Mail::POP3Client;
use FileHandle;

my $pop3_server='yourmailserver';
my $pop3_password='estanoes';
my ($pop3_user,$pop,$linea);

my $fh=new FileHandle "</home/lgstosej/tmp/passwd";
if (!defined $fh){
	 $fh->close;
	 die $!;
}

while ($linea=($fh->getline))
{
	 if ($linea=~ /([^\:]+)\:.*/){
		  $pop = new Mail::POP3Client( USER     => "$1*testing",
												 PASSWORD => $pop3_password,
												 HOST     => $pop3_server,
												 PORT     => 10995,
												 USESSL   => 1
												 );
		  if ($pop->Count > 1000){
				print "".$1.", tienes ".$pop->Count." mensajes\n";
		  }
# 		  if ($pop->Alive) {
# 				print "".$1.", tienes ".$pop->Count." mensajes\n";
# 		  } else {
# 				print "Problemas con ".$1."\n";
# 		  }
	 }
}
