Re[4]: Mail::Box 2.054 POP3 issues
Jason Woodward <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <[email protected]> |
> IMO, any statement which is too much must be removed, so even a
> UNIVERSAL::can. The code is already large enough without unnecessary
> additions :-(
Well you are the author so it is up to you. But there is something going wrong that a `die
unless isa() || can()` would catch.
> So, the server reports a logout, and then complaints about a lock still
> being hold on that folder which breaks the re-open. Doesn't look to me
> as a MailBox client problem.
Don't be so dismissive. Here is the pop3 log when I am just opening one connection, then call
mgr->closeAllFolders():
### begin log
Apr 5 10:04:18 MAILHOST ipop3d[29644]: pop3 service init from MAILCLIENTIP
Apr 5 10:04:18 MAILHOST ipop3d[29644]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:04:18 MAILHOST ipop3d[29644]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:04:18 MAILHOST ipop3d[29645]: pop3 service init from MAILCLIENTIP
Apr 5 10:04:19 MAILHOST ipop3d[29645]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:04:20 MAILHOST ipop3d[29645]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
Simply opening the pop3 connection once via Mail::Box causes the server to be popped twice.
With previous versions of Mail::Box, this was not the case. Now, if I put add a sleep call and
then try to reopen the same pop3 connection:
### begin log
Apr 5 10:05:57 MAILSERVER ipop3d[29652]: pop3 service init from MAILCLIENTIP
Apr 5 10:05:57 MAILSERVER ipop3d[29652]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:05:57 MAILSERVER ipop3d[29652]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:05:57 MAILSERVER ipop3d[29653]: pop3 service init from MAILCLIENTIP
Apr 5 10:05:57 MAILSERVER ipop3d[29653]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
# sleep pause
Apr 5 10:06:00 MAILSERVER ipop3d[29654]: pop3 service init from MAILCLIENTIP
Apr 5 10:06:00 MAILSERVER ipop3d[29654]: Trying to get mailbox lock from process 29653
Apr 5 10:06:14 MAILSERVER ipop3d[29654]: Mailbox is open by another process, access is readonly
Apr 5 10:06:14 MAILSERVER ipop3d[29654]: Error opening or locking INBOX user=MAILUSER
host=MAILCLIENT [MAILCLIENTIP]
Apr 5 10:06:14 MAILSERVER ipop3d[29654]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP] no
mailbox
Apr 5 10:06:14 MAILSERVER ipop3d[29654]: Expunge ignored on readonly mailbox
Apr 5 10:06:14 MAILSERVER ipop3d[29654]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:06:14 MAILSERVER ipop3d[29653]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
Notice that the second of the first two connections that are opened (before the sleep and then
the subsequent open call) is not closed in time.
2.047 doesn't exhibit this behavior (using the same script):
### begin log
Apr 5 10:34:34 MAILSERVER ipop3d[29864]: pop3 service init from MAILCLIENTIP
Apr 5 10:34:34 MAILSERVER ipop3d[29864]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:34:36 MAILSERVER ipop3d[29864]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
# sleep pause
Apr 5 10:34:39 MAILSERVER ipop3d[29865]: pop3 service init from MAILCLIENTIP
Apr 5 10:34:39 MAILSERVER ipop3d[29865]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:34:41 MAILSERVER ipop3d[29865]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.048 doesn't exhibit this behavior (using the same script):
### begin log
Apr 5 10:36:39 MAILSERVER ipop3d[29873]: pop3 service init from MAILCLIENTIP
Apr 5 10:36:39 MAILSERVER ipop3d[29873]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:36:41 MAILSERVER ipop3d[29873]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
# sleep pause
Apr 5 10:36:44 MAILSERVER ipop3d[29874]: pop3 service init from MAILCLIENTIP
Apr 5 10:36:44 MAILSERVER ipop3d[29874]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:36:46 MAILSERVER ipop3d[29874]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.049 doesn't exhibit this behavior (using the same script):
### begin log
Apr 5 10:40:00 MAILSERVER ipop3d[29886]: pop3 service init from MAILCLIENTIP
Apr 5 10:40:00 MAILSERVER ipop3d[29886]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:40:02 MAILSERVER ipop3d[29886]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
# sleep pause
Apr 5 10:40:05 MAILSERVER ipop3d[29921]: pop3 service init from MAILCLIENTIP
Apr 5 10:40:05 MAILSERVER ipop3d[29921]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:40:07 MAILSERVER ipop3d[29921]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.050 doesn't exhibit this behavior (using the same script):
### begin log
Apr 5 10:43:39 MAILSERVER ipop3d[29932]: pop3 service init from MAILCLIENTIP
Apr 5 10:43:39 MAILSERVER ipop3d[29932]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:43:41 MAILSERVER ipop3d[29932]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
# sleep pause
Apr 5 10:43:44 MAILSERVER ipop3d[29933]: pop3 service init from MAILCLIENTIP
Apr 5 10:43:44 MAILSERVER ipop3d[29933]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:43:46 MAILSERVER ipop3d[29933]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.051 doesn't exhibit this behavior (using the same script):
### begin log
Apr 5 10:45:06 MAILSERVER ipop3d[29943]: pop3 service init from MAILCLIENTIP
Apr 5 10:45:06 MAILSERVER ipop3d[29943]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:45:07 MAILSERVER ipop3d[29943]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
# sleep pause
Apr 5 10:45:10 MAILSERVER ipop3d[29944]: pop3 service init from MAILCLIENTIP
Apr 5 10:45:11 MAILSERVER ipop3d[29944]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:45:12 MAILSERVER ipop3d[29944]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.052 is the first version to exhibit this behavior, and the isModified bug rears its ugly head
here as well (using the same script):
### begin log
Apr 5 10:47:15 MAILSERVER ipop3d[29957]: pop3 service init from MAILCLIENTIP
Apr 5 10:47:15 MAILSERVER ipop3d[29957]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:47:15 MAILSERVER ipop3d[29957]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:47:16 MAILSERVER ipop3d[29958]: pop3 service init from MAILCLIENTIP
Apr 5 10:47:16 MAILSERVER ipop3d[29958]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
# sleep pause
Apr 5 10:47:21 MAILSERVER ipop3d[29959]: pop3 service init from MAILCLIENTIP
Apr 5 10:47:21 MAILSERVER ipop3d[29959]: Trying to get mailbox lock from process 29958
Apr 5 10:47:35 MAILSERVER ipop3d[29959]: Mailbox is open by another process, access is readonly
Apr 5 10:47:35 MAILSERVER ipop3d[29959]: Error opening or locking INBOX user=MAILUSER
host=MAILCLIENT [MAILCLIENTIP]
Apr 5 10:47:35 MAILSERVER ipop3d[29959]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP] no
mailbox
Apr 5 10:47:35 MAILSERVER ipop3d[29959]: Expunge ignored on readonly mailbox
Apr 5 10:47:35 MAILSERVER ipop3d[29959]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:47:35 MAILSERVER ipop3d[29958]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
2.053 also exhibits this behavior along with the isModified bug as well (using the same script):
### begin log
Apr 5 10:50:53 MAILSERVER ipop3d[30000]: pop3 service init from MAILCLIENTIP
Apr 5 10:50:53 MAILSERVER ipop3d[30000]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
Apr 5 10:50:53 MAILSERVER ipop3d[30000]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:50:53 MAILSERVER ipop3d[30001]: pop3 service init from MAILCLIENTIP
Apr 5 10:50:53 MAILSERVER ipop3d[30001]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102/102
# sleep pause
Apr 5 10:50:59 MAILSERVER ipop3d[30002]: pop3 service init from MAILCLIENTIP
Apr 5 10:50:59 MAILSERVER ipop3d[30002]: Trying to get mailbox lock from process 30001
Apr 5 10:51:13 MAILSERVER ipop3d[30002]: Mailbox is open by another process, access is readonly
Apr 5 10:51:13 MAILSERVER ipop3d[30002]: Error opening or locking INBOX user=MAILUSER
host=MAILCLIENT [MAILCLIENTIP]
Apr 5 10:51:13 MAILSERVER ipop3d[30002]: Login user=MAILUSER host=MAILCLIENT [MAILCLIENTIP] no
mailbox
Apr 5 10:51:13 MAILSERVER ipop3d[30002]: Expunge ignored on readonly mailbox
Apr 5 10:51:13 MAILSERVER ipop3d[30002]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
Apr 5 10:51:13 MAILSERVER ipop3d[30001]: Logout user=MAILUSER host=MAILCLIENT [MAILCLIENTIP]
nmsgs=102 ndele=0
### end log
> The log says it does logout, what more evidence do you need?
Let me know if you need more information regarding this issue.
Thanks and take care,
jason
### begin test script
#!/usr/bin/perl
$|++;
use strict;
use warnings;
use Mail::Box::Manager;
sub open_pop3 {
my $manager = shift;
return $manager->open(
type => "pop3",
username => "USER",
password => "PASS",
server_name => "HOST",
server_port => "110",
) or die "Failed to open pop3: $!";
}
my $manager = Mail::Box::Manager->new();
print "opening initial connection\n";
my $pop3 = open_pop3($manager);
# do some work...
# close all open folders, committing all deletes on the pop3 server, etc
print "closing all folders\n";
$manager->closeAllFolders();
sleep 3;
# re-open the connection to do further work
print "opening pop3 again\n";
$pop3 = open_pop3($manager);
### end test script