http://qs321.pair.com?node_id=303567

jarp has asked for the wisdom of the Perl Monks concerning the following question:

I need some expert advice/guidance. I'm trying to use a Net::POP3 object to talk to our Exchange server. From my desktop PC (running 5.8.0 ActiveState, Windows 2000, Service Pack 4) which is behind our firewall, I can retrieve the messages in my inbox. The Exchange server is also behind the firewall. All is well, I have proof of concept.

I can't have production code on my desktop, so I moved the code to our FTP server (running 5.6.1 ActiveState, Windows 2000, Service Pack 4), in the DMZ. I put the Exchange server in the local hosts file, ran the code, and get the following:

Can't open connection to ms240ex02.sysco.com : Unknown error

I get no more information when I create the object with Debug => 1. My code is simple --

# # use strict; use Net::POP3; my $server = "ms240ex02.sysco.com"; my $username = "valid_user"; my $password = "valid_password"; my $messages; my $message; my $msgid; my $pop = Net::POP3->new($server, Debug => 1) || die "Can't open connection to $server : $!\n"; defined ( $pop->login($username, $password) ) || die "Can't authenticate: $!\n"; $messages = $pop->list || die "Can get list of messages : $!\n"; foreach $msgid (keys %$messages) { $message = $pop->get($msgid); if ( $message ) { #succeeded print "\n"; print @$message; } else { #failed warn "Couldn't fetch $msgid from mail server ; $!\n"; next; } }
I've looked in the docs, and can't find any more information about what may be going on, so came to the Monks for expert advice!

My ultimate goal is to check the contents of an inbox using perl, tapping the Exchange server from a remote host.

Suggestions/comments/advice, always welcome!