Reading my mail with a script

I’m trying to user perl to write a script to basically look through my mail for a specific automated message and then it can alert me of it. Anyway, that part’s not important. I can’t get Net::POP3 to connect. Here’s all I have:

my $ServerName = “”;
my $pop3 = new Net::POP3($ServerName) or die(“Couldn’t connect to server”);
my $username = “username”;
my $password = “password”;
my $numMessages = $pop3->login($username, $password) or die(“Couldn’t login to server”);
my $messages = $pop3->list();

And it gives me this:

Couldn’t login to server at line 42.

Yes, I’ve checked the username and password, and yes I edited them out of this code. What else do I need to get it to connect? Something more than the username and password maybe? I’m pretty sure we don’t have a pre-installed PHP module to do this or else I’d use PHP. I don’t want to learn Python syntax (tho I should one of these days anyway). Maybe there’s another simpler option? I really hate perl, but I’ll use it if I have to.

Hey, this still doesn’t work. I’ve tried IMAP and now POP3Client. Nothing can log in even tho I know the username and password are correct. They’re just little words and I can log in when I copy and paste them into the squirel mail login page. Does anyone have any clue? I read in the kb to use port 995.

my $socket = IO::Socket::SSL->new(PeerAddr => “”, PeerPort => 995, Proto => “tcp”) or die(“Couldn’t create socket.”);
my $pop3 = Mail::POP3Client->new();


PASS failed: -ERR Login failed.

for the user name do you need to be using the m123456 login, instead of what works for webmail? That’s what you have to do if you install your own webmail client, not sure if that applies to what you’re trying to accomplish, but it probably does.


Whoa, that did it. Finally. Thanks. Dreamhost is weird sometimes.