Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-02-2005, 09:37 AM   #1
Registered: Oct 2003
Location: Croatia
Distribution: Fedora 4
Posts: 46

Rep: Reputation: 15
perl script to report new mail

this is a perl script run by cynapses_karamba. It is supposed to get new mail count from gmail. The problem is that it always dies at "Couldn't log on to server". I've enabled POP3 on gmail. I haven't really programmed in perl, so it's hard for me to debug. Can someone tell what is wrong:
use Net::POP3;

my $ServerName = "";
# If your username contains a @ character you
# must replace it with \@
my $UserName = "myusrname\";
my $Password = "my_pass";
my $pop3 = Net::POP3->new($ServerName,Timeout => 5);
die "Couldn't log on to server" unless $pop3;

my $Num_Messages = $pop3->login($UserName, $Password) + 0;
if ( $Num_Messages == 1 ){
   print $Num_Messages ." new\n";
elsif ( $Num_Messages > 1 ){
    print $Num_Messages ." new\n";
    print "0 new\n";

For those of you who have cynapses_karamba, have you managed to enable network ingoing/outgoing graph? I haven't
Old 07-02-2005, 10:13 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
I think you need to use ssl with gmail. I'd either set up an stunnel wrapper for that script or us this cpan module instead of Net::POP3:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl question: how to insert an e-mail address in a script Pastorino Programming 3 08-08-2005 09:28 AM
Converting a Windows Perl script to a Linux Perl script. rubbercash Programming 2 07-19-2004 11:22 AM
howto send a mail with attachment via perl script ? cccc Programming 24 03-05-2004 08:49 PM
Mail script with Perl & Postfix Bladez Programming 2 02-14-2004 10:59 PM
I'm looking for a simply perl script to send mail, when ping down cccc Programming 2 01-12-2004 05:36 AM

All times are GMT -5. The time now is 07:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration