Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

pop3-check

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 foo792@netzero.net
Description:
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: http://www.cpan.org/modules/by-module/Net/libnet-1.0606.tar.gz. Example: pop_check <server_name> <account> <password>
#!/usr/bin/perl
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";
exit($_[0]);
}

Comment on pop3-check
Download Code
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.
        cheers,
        ybiC
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
    killerhippy
      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
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 (www.stunnel.org)

    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 (perlmonk@viot.de)
      pls send me the source code of outlook express if it is available..at aravind639@yahoo.com

Back to Code Catacombs

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://21006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (16)
As of 2014-07-14 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (268 votes), past polls