Wise Monks, here is a POP3 mystery.
I can use the following code snippet to get POP mail from other servers, but not from the one this code runs on. I have used several versions of the user name, including using the full domain name. The debug output at the end seems to show that the login fails on the password. I have turned on and off dovecot, no effect. Evolution works as does the mail command, but not Net::POP3. This is on Fedora Core 4, with a one week old yum update. I have also used the POP3 apop() method, no effect. I've searched in PM and pickings are thin on Net::POP3. The MTA is sendmail.
Your advice would be most appreciated!
David Drake
#!/usr/bin/perl -w
use strict;
# File readpop.pl
# David Drake
use Net::POP3;
use Mail::Header;
use FileHandle;
use Net::SMTP; #to send mail
use Time::Local; # for seconds from 1/1/1970 usage
# Here we create the pop object and attempt to login
my $pop = Net::POP3->new('goodhost.com', Timeout => 10, Debug =>1) or
+die "Cant connect to host: $!\n";
#we have connected successuflly
my $muser = 'goodname';
my $passwd='goodpass';
$pop->login($muser,$passwd) or die "No Login ",$pop->message;
#The above generates the login error
die "Success\n";
**************************************************
Here is the output, from the POP3 debug
# ./readpop.pl
Net::POP3>>> Net::POP3(2.28)
Net::POP3>>> Net::Cmd(2.26)
Net::POP3>>> Exporter(5.58)
Net::POP3>>> IO::Socket::INET(1.27)
Net::POP3>>> IO::Socket(1.28)
Net::POP3>>> IO::Handle(1.24)
Net::POP3=GLOB(0x9ef7988)<<< +OK Hello there.
Net::POP3=GLOB(0x9ef7988)>>> USER goodname
Net::POP3=GLOB(0x9ef7988)<<< +OK Password required.
Net::POP3=GLOB(0x9ef7988)>>> PASS ....
Net::POP3=GLOB(0x9ef7988)<<< -ERR Login failed.
No Login Login failed.