Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:
Is there a trick to get Net::POP3 to check multiple mailboxes on a server for the purpose of determining the number of pending messages? I've tried the following code and it works fine for the first user, but subsequent users come up with no mail, when I know there is mail there. Setting it up with a single user login/pw it works like a champ, but I'd like a way to just do a simple check every now and again to see if it's piling up.
The reason I'm doing this is that I've got a user on the system who is complaining of e-mail retrieval being slow and I want something to physically show them why it is so slow and going to get worse if they don't clean out their mailbox. Fortunately it's only affecting the one user, not everyone.
use strict; use Net::POP3; $|++; my %user = ( a => 1 , b => 2, c => 3); my $host = "host.net"; my $pop = Net::POP3->new($host); for my $key ( keys %user){ print "Working on $key...\n"; my $msg = $pop->login( $key, $user{$key} ); print "$key: $msg\n"; $pop->quit; }
I've tried using a sleep(15) after the $pop->quit so that the server had time to reset, but that didn't work either.
Can anybody shed light on why this behaves the way it does, or is that the expected behavior?
I would love to change the world, but they won't give me the source code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking muliptle mailboxes on same server with Net::POP3
by Joost (Canon) on Apr 13, 2007 at 00:15 UTC | |
by Popcorn Dave (Abbot) on Apr 13, 2007 at 02:54 UTC |