# POP3Client dies with "Broken pipe" and nothing else. # (works fine with external server) use strict; use Mail::POP3Client; my $pop3 = new Mail::POP3Client( HOST => "localhost" ); $pop3->User( "somebody" ); $pop3->Pass( "doublesecret" ); $pop3->Connect() || die "failed: " . $pop3->Message() . "\n"; $pop3->Close(); #### # Host is valid, user/pass are not. use strict; use Net::POP3; my $host = 'biztos.com'; # valid POP3 host, feel free to test against it. my $user = 'foobar'; # nonexistent user my $pass = 'badpass'; # dummy password my $pop3 = Net::POP3->new($host,Timeout => 30,Debug => 1); die "connect failed: $!\n" unless $pop3; # this works fine. # try apop first: my $apop_messages = $pop3->apop($user,$pass); if ($apop_messages) { $pop3->quit(); print "apop ok.\n"; } else { print "apop didn't work, trying login ($!)\n"; # the above $! is "No such file or directory" # ...and debug didn't show anything, so I'm assuming # apop() just skipped it due to presumed incompatibility. # on my localhost it shows the apop transaction. my $pop_message = $pop3->login($user,$pass); if ($pop_message) { $pop3->quit(); print "login ok.\n"; } else { $pop3->quit(); die "login failed: $!\n"; # the above $! is "Bad file descriptor" but the # POP3 server said: # "-ERR Username/Password Mismatch perhaps foobar@yourdomain.com ?" } }