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 --
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!# # 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; } }
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!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::POP3
by pinetree (Scribe) on Oct 31, 2003 at 15:54 UTC | |
by jarp (Novice) on Oct 31, 2003 at 15:58 UTC | |
by phydeauxarff (Priest) on Oct 31, 2003 at 16:00 UTC | |
by jarp (Novice) on Oct 31, 2003 at 16:31 UTC | |
by phydeauxarff (Priest) on Oct 31, 2003 at 16:35 UTC | |
| |
by jarp (Novice) on Oct 31, 2003 at 16:40 UTC |
Back to
Seekers of Perl Wisdom