Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?


by Shotgun Bob (Beadle)
on Jul 04, 2000 at 17:25 UTC ( #21006=sourcecode: print w/replies, xml ) Need Help??
Category: E-Mail Programs
Author/Contact Info
This perl script checks your e-mail account with the flags that you provide at the command line. NOTE: This perl script requires the Net::POP3 module. Get it from: Example: pop_check <server_name> <account> <password>
use Net::POP3;
usage(0) if "-h" eq $ARGV[0]; || "-help" eq $ARGV[0];
usage(1) if 2 != $#ARGV;
($hostname, $account, $password) = @ARGV;
$handle = Net::POP3->new($hostname) or die "Unable to establish a POP3
+ connection to $hostname.\n";
defined($handle->login($account, $password)) or die "Unable to authent
+icate ($account, $password) at $hostname.\n";
$message_list = $handle->list or die "Unable to retreive list of avaib
+le mesages.\n";
foreach $item (keys %$message_list) {
$header = $handle->top($item);
print @$header;

sub usage {
print "Use this utility as 'pop_check HOSTNAME ACCOUNT PASSWORD',\n";
print " or 'pop_check -help', to see this message.\n";
Replies are listed 'Best First'.
Re: pop3-check
by LupoX (Pilgrim) on Nov 20, 2001 at 19:39 UTC

    We startet a small project called "traymail" which is a mailclient for windows, featuring imap, POP3 AND security by ssl encryption. We had to take the uncool way using a tunnel programm called stunnel (

    perhaps this is also usefull for your script since it sends plain passwords now.

    Take a look at our bullettin board for information about the traymail project.

    Have a good time...
    Georg (
      pls send me the source code of outlook express if it is
Re: pop3-check
by khippy (Scribe) on Sep 18, 2001 at 12:34 UTC
    Hi Shotgun Bob,

    I have just read the code and I have found the line
    about list of messages. What do you think about
    enhancing your code to enable deleting unwanted
    messages at the mailserver (dele <msgnr>) directly to
    prevent you from downloading them?
    there are no silly questions
      I wrote a simple script that does essentially this. I even wrote a little scheduler for it as NT isn't as neat as *nix for scheduling. I felt very proud, then I discovered that Lincon Stein's book had pretty much the same thing in already, plus his was better.

      Have a look at his book, it's got a very good desciption of all things Net:: and CGI. Perl Network Programming

RE: pop3-check (is it secure?)
by ybiC (Prior) on Jul 05, 2000 at 08:20 UTC
    This looks like something I could use for one of my POP3 accounts that's otherwise inconvenient to access.

    Can senior Monks offer thoughts on viability or security of this little goody ?

    No offense intended here, Shotgun Bob. I'm just not terribly adept at OOP and have never delved into Net::POP3.
Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://21006]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2018-04-23 20:14 GMT
Find Nodes?
    Voting Booth?