Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Purge messages not working properly

Quote Reply
Purge messages not working properly
When using 2.1.0 if I go to purge messages and select only the trash folder as criteria the popup status box seems to hang when there are more than 1000 messages. If I add a date constraint to reduce the number of messages below 1000 it does not hang and says it deleted all of them but when I do another purge for the same time period it shows 25 less than before. Each time I redo it it shows 25 less. So it appears it is hanging above 1000 and anything below does not hang and purges in increments of 25 even though it says all are purged. Any ideas?
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
Oh! This happened to me always. I do not think there is a bug, but perhaphs either the scrip is getting killed somewhere due to some strange reason or it is supposed to delete 20 - 25 messages each time.

This has happened to me WITHOUT an exception and I cannot beleive that it could be due to any message header etc, problem.

As you may checkout my earlier message Trash bug or delete bug title from the posts I have made. This is explained more how I have solved it and think about it.

Interestingly the empty folder works SO EFFECTIVE in comparision to purge. May be because for purge function, it has to connect database so many times and put everything into RAM, as compared to only data of one user and the respective connection. However, I say this here without even looking at the code and hence it is a simple presumption, so I could be wrong.

Last edited by:

rajani: Jul 31, 2002, 2:27 AM
Quote Reply
Re: [rajani] Purge messages not working properly In reply to
Thanks for your comments Rajani. Well I would consider it a bug since:

1) The message says all are deleted but only 25 of the requested ones were - both cannot be correct.

2) It appears the purge messages function is intended to be a global function to be used for example if an admin wants to delete everyones trash. Somehow I doubt it is intended behavior to limit it to 25 deletions at a time. At that rate it will take 40 trys to delete just 1000 messages. Imagine if one had to delete 10,000 trash messages it would take 400 trys!

As far as why it locks up when over 1000 are purged, it could be a server resource issue but without looking at the code I am not sure how it is done so we'll have to wait for an official response on that one.

Anyone have any other ideas? Adrian, Alex?

Thanks!
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
Sorry it took so long to reply, but I took a look at the problem and I've got a fix for you. If you open up admin/GMail/Admin/Purge.pm, and go to line ~26, you'll see:
Code:
$IN->delete('do');
my $cgi = $IN->get_hash;
Change that to be (well, add in that line):
Code:
$IN->delete('do');
$IN->delete('action');
my $cgi = $IN->get_hash;
And it should fix the purge problem.

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
Hi, thanks for looking into it. I could not find the code around line 26 but did find it around 140 and applied the change as you specified but unfortunately it is still acting the same on 2.1.0. That is it is only deleting 25 at a time even though it reports back that all are deleted when I try to purge everyones trash. I did see the following code around 257 ...

$cgi->{mh} ||= 25;

Any other ideas?

Last edited by:

JKelly: Aug 12, 2002, 5:49 PM
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
oops, don't know what number I was looking at, but as you said, it's nowhere near line 25 Smile. It's on line ~148, right in sub msgs_calc.

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
Well I have GMail 2.1.0 and the version info for Purge.pm is below ...

# CVS Info : 087,069,080,087,083
# Revision : $Id: Purge.pm,v 1.10 2001/09/19 23:04:51 sbeck Exp $

It contains the following on lines 140 and 141

140 $IN->delete('do');
141 my $cgi = $IN->get_hash;

I changed it to ...

140 $IN->delete('do');
141 $IN->delete('action');
142 my $cgi = $IN->get_hash;

There is no such code on line 148 in my version but in any case, I think I changed the code you were refering to and it did not fix it. Since it is deleting only 25 at a time I thought it might have something to do with the code I posted before ...

$cgi->{mh} ||= 25;

.. which appears in the sub _build_query_cond section What do you think?
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
Adrian, when you get a chance can you take another look at this? Thanks!
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
Can you explain the problem a little more please? For me, initially on my install, purges with over 1000 messages didn't work at all (I'd get a pop up box saying not to close it till it was done). After making that addition, it worked.

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
I am trying to purge all users messages that are in their trash folder using the "Purge Messages" page in the "Users" section. The only selection I make on that page is I select the trash folder. It finds say 1000s and asks if I want to delete them. I say yes and it reports back all are deleted. Problem is all are not deleted - only 25. The reason I know this is that:

1) I check the message statistics and it shows only 25 less than before the purge.

2) I repeat the process and it finds 25 less than the last time I tried - it should find none if it actually deleted them all like its says it did.

Hope this help you to understand what it is doing wrong.
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
That line of code you posted before ($mh ||= 25) shouldn't be a concern as mh is set earlier in the code. I've attached a copy of Purge.pm that you can try.

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
Thanks but it did not help. It still reports back all are deleted, yet only 25 actually are. Is it possible $mh is not getting set earlier in the code for some reason and thus it is defaulting to 25? All I am selecting on the form before I submit the page is the Trash folder from the drop down menu - nothing else - then I click the Yes link on the subsequent page. Do I need to select anything else in that form in order for $mh to get set properly?
Quote Reply
Re: [JKelly] Purge messages not working properly In reply to
Would it be possible to get shell access and admin access to try debug this?

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
That can be arranged, please email me for the info.
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
Ok, I am having the same problem - it purges only 25 messages at a time.

Did you find the bug?

Strangely enough, when I purge all messages from the Trash folders it deletes them all. This is the only case when it works fine.

rgrdz,
.\\ike
Quote Reply
Re: [TukBa] Purge messages not working properly In reply to
This bug only occurs when you're attempting to purge more than 1000 messages. You need to modify GMail/Admin/Purge.pm, around line 270:
Code:
$cgi->{mh} ||= 25;
to:
Code:
$cgi->{mh} ||= -1;

Adrian
Quote Reply
Re: [brewt] Purge messages not working properly In reply to
  
Thanks Adrian. I will try your fix.

BTW, the problem I was having occured when the total number of messages was less than 1000.

Thank you very much!

rgrdz,
.\\ike

Last edited by:

TukBa: Sep 16, 2002, 4:29 PM