Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 32545
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: mikee [...] pointwise.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Oddness in Mail::IMAPClient
Date: Tue, 22 Jan 2008 17:07:21 -0600
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Mike Eggleston <mikee [...] pointwise.com>
I have a script (inline below) that did run fine, then something changed and I get errors when I run the script. The script still works (I removed the error printing lines), but I still get an error with two user accounts. When I run this script I hit the first user account (of two that generate the error) and the output is: [cyrus@elo dgarlisch]$ !time time /opt/pwi/bin/cyrus-expunge.pl -v ; date Deep recursion on subroutine "Mail::IMAPClient::Massage" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1818. Deep recursion on subroutine "Mail::IMAPClient::status" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 2718. Out of memory! Any idea what's happening or how I fix this? I currently have a line in the code to skip around these two accounts. I don't understand what is different about the accounts that is causing a problem. Both accounts are new (in the last month or so) and have almost nothing in them. Mike P.S. I just updated to version 'Mail-IMAPClient-3.03-MC9xib'. I'm going to run the script again before I send this mail to you. Well, the script worked with the updated module. I'm sending you this email anyway on the off chance tie error or the script below may be of some use to you. ------------------------------------------ cyrus-expunge.pl start #!/usr/bin/perl #$Id: cyrus_expunge.pl,v 19991216.3 2003/06/12 21:38:31 dkernen Exp $ # modified by mikee for the pointwise environment use Mail::IMAPClient; use IO::File; use Getopt::Std; # parse the command line our($opt_v, $opt_s) = (0, 0); getopts('sv') or die "usage: $0 [-v]"; $opt_s = 1 if $opt_v; $| = 1; my $start = time; # Change the following line (or replace it with something better): my($h, $u, $p) = ('imap.pointwise.com', 'cyrus','cyrus'); my $imap = Mail::IMAPClient->new( Server => "$h", # imap host User => "$u", # $u, Password=> "$p", # $p, Uid => 1, # True value Port => 143, # Cyrus Buffer => 4096*100, # True value Fast_io => 1, # True value Timeout => 30, # True value Debug => 0, # True value #Debug_fh=> IO::File->new('>/tmp/imap.out'), # must be a fhandle ) or die "$@"; our($folder, $cnt, $purged) = ('', 0, 0); our($nfolders, $nmessages, $nremoved) = (0, 0, 0); for my $f ( $imap->folders ) { $folder = $f; $nfolders++; undef $@; undef $_; next unless $f =~ /dgarlisch/oi; #next if $f =~ /dgarlisch|rdennis/oi; $imap->setacl($f, $u, 'lrswipcda') or print "$0: Cannot setacl for $f: $@\n" and next; unless ($imap->select($f) ) { $imap->setacl($f, $u, 'lrswipcda') or print "$0: Cannot setacl for $f: $@\n" and next; $imap->select($f) or print "$0: Cannot select $f: $@\n" and next; } my $messages_before = $imap->message_count($f); if(defined($messages_before)) { $imap->expunge; $imap->close or print "$0: Could not close: $@\n"; $imap->select($f) or print "$0: Cannot select $f: $@\n" and next; my $messages_after = $imap->message_count($f); $cnt = $messages_before > $messages_after ? $messages_before : $messages_after; $purged = $messages_before - $messages_after; $nmessages += $cnt; $nremoved += $purged; } else { $cnt = $purged = -1; } write if $opt_v; } # write a summary if($opt_s) { my $stop = time; print "\nSummary:\n"; print "Elapsed Seconds: ", ($stop - $start), "\n"; print "Total Folders: $nfolders\n"; print "Total Messages: $nmessages\n"; print "Total Removed: $nremoved\n"; } format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>> @>>>>> $folder, $cnt, $purged . format STDOUT_TOP = Folder Count Purged --------------------------------------------------------- ----- ------ . ------------------------------------------ cyrus-expunge.pl end
Subject: Re: [rt.cpan.org #32545] Oddness in Mail::IMAPClient
Date: Wed, 23 Jan 2008 10:47:17 +0100
To: "mikee [...] pointwise.com via RT" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: NLnet webmaster <webmaster [...] nlnet.nl>
* mikee@pointwise.com via RT (bug-Mail-IMAPClient@rt.cpan.org) [080122 23:07]: Show quoted text
> Tue Jan 22 18:07:44 2008: Request 32545 was acted upon. > Transaction: Ticket created by mikee@pointwise.com > Queue: Mail-IMAPClient > Subject: Oddness in Mail::IMAPClient
Within a list of bug-reports, this subject is not really discriptive. Show quoted text
> I have a script (inline below) that did run fine, then something changed > and I get errors when I run the script.
You changed something in the code, or some else installed a new release of Mail::IMAPClient? Show quoted text
> The script still works (I removed the error printing lines), but > I still get an error with two user accounts. When I run this script I > hit the first user account (of two that generate the error) and the > output is:
I suspect they have some folder names which are "weird" in some sense. Show quoted text
> [cyrus@elo dgarlisch]$ !time > time /opt/pwi/bin/cyrus-expunge.pl -v ; date > Deep recursion on subroutine "Mail::IMAPClient::Massage" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1818. > Deep recursion on subroutine "Mail::IMAPClient::status" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 2718.
In release 3.03, this recursion was removed. In the old code (pre 3), Massage was called on many places, often on far too many locations, causing all kinds of bug. I have simplified it a lot, which makes it maintainable, apparently missing some case. I hope you can help me find it. Show quoted text
> I just updated to version 'Mail-IMAPClient-3.03-MC9xib'.
^^^^^^ what's this? Show quoted text
> Well, the script worked with the updated module. I'm sending you this > email anyway on the off chance tie error or the script below may be > of some use to you.
Ah, gladly. The optimistic news is at the end. So the problem disappeared and the ticket can be closed? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #32545] Oddness in Mail::IMAPClient
Date: Wed, 23 Jan 2008 07:55:53 -0600
To: NLnet webmaster via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mike Eggleston <mikee [...] pointwise.com>
On Wed, 23 Jan 2008, NLnet webmaster via RT might have said: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=32545 > > > * mikee@pointwise.com via RT (bug-Mail-IMAPClient@rt.cpan.org) [080122 23:07]:
> > Tue Jan 22 18:07:44 2008: Request 32545 was acted upon. > > Transaction: Ticket created by mikee@pointwise.com > > Queue: Mail-IMAPClient > > Subject: Oddness in Mail::IMAPClient
> > Within a list of bug-reports, this subject is not really discriptive.
True, though if I had a better description I would have given it. Show quoted text
> > I have a script (inline below) that did run fine, then something changed > > and I get errors when I run the script.
> > You changed something in the code, or some else installed a new release > of Mail::IMAPClient?
I updated the module from the CPAN repository. Show quoted text
> > The script still works (I removed the error printing lines), but > > I still get an error with two user accounts. When I run this script I > > hit the first user account (of two that generate the error) and the > > output is:
> > I suspect they have some folder names which are "weird" in some sense.
I thought of that possiblity. Scanning all folders at the file system level I didn't see anything to me that was odd. These people are windows people, so there are spaces and such in folder names. Show quoted text
> > [cyrus@elo dgarlisch]$ !time > > time /opt/pwi/bin/cyrus-expunge.pl -v ; date > > Deep recursion on subroutine "Mail::IMAPClient::Massage" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1818. > > Deep recursion on subroutine "Mail::IMAPClient::status" at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 2718.
> > In release 3.03, this recursion was removed. In the old code (pre 3), > Massage was called on many places, often on far too many locations, > causing all kinds of bug. I have simplified it a lot, which makes it > maintainable, apparently missing some case. I hope you can help me > find it.
If I can I will. I have a few scripts I need to write and I'll happily pass those scripts along. Show quoted text
> > I just updated to version 'Mail-IMAPClient-3.03-MC9xib'.
> ^^^^^^ what's this?
That is what 'perl -MCPAN -e shell' reported for the module as I updated the module. Show quoted text
> > Well, the script worked with the updated module. I'm sending you this > > email anyway on the off chance tie error or the script below may be > > of some use to you.
> > Ah, gladly. The optimistic news is at the end. So the problem > disappeared and the ticket can be closed?
Yes, things seem to be fine now. Mike
Subject: Re: [rt.cpan.org #32545] Oddness in Mail::IMAPClient
Date: Wed, 23 Jan 2008 16:26:50 +0100
To: "mikee [...] pointwise.com via RT" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* mikee@pointwise.com via RT (bug-Mail-IMAPClient@rt.cpan.org) [080123 13:56]: Show quoted text
> > > Transaction: Ticket created by mikee@pointwise.com > > > Queue: Mail-IMAPClient > > > Subject: Oddness in Mail::IMAPClient
> > > > Within a list of bug-reports, this subject is not really discriptive.
> > True, though if I had a better description I would have given it.
"Deep recursion in Massage/status" Show quoted text
> > > I just updated to version 'Mail-IMAPClient-3.03-MC9xib'.
> > ^^^^^^ what's this?
> > That is what 'perl -MCPAN -e shell' reported for the module as I updated > the module.
Ah, that is the name which is used in the ~/.cpan/build directory... it adds some random string to avoid conflicts with parallel builds of the same module for different Perls (as f.i. the CPAN testers are doing) The name of the distribution is Mail-IMAPClient-3.03 Show quoted text
> Yes, things seem to be fine now.
Great. I welcome all reports, don't hessitate. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
problems was already fixed in 3.03