Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: very large mailbox crashes hmailserver
PostPosted: 2008-05-06 05:55 
New user
New user

Joined: 2007-10-15 21:06
Posts: 11
I have a user that has 17GB of mail (yes, that's 17gb, and they've been spoken to...). In trying to clean up, they managed to shove 623,000+ messages into the trash folder.

All imap clients die on this (can't enum messages, can't compact, etc.), and the only thing I was able to do was to install squirrelmail, rename the Trash folder to TrashHUGE, create a new Trash folder, then delete TrashHUGE.

Now all imap clients show that TrashHUGE folder to be gone, but I still can't compact, empty trash, etc. without hmailserver and mysql spiking the CPU and eventually crashing after about 5 or 10 minutes.

I tried going into the SQL table, but can't find anything promising...

Anyone have any suggestions on how to remove the non-pertinent messages from the OS, and the SQL references to said messages from the db?

...or any other helpful suggestions?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: very large mailbox crashes hmailserver
PostPosted: 2008-05-06 06:45 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 4546
Location: 'The Outback' Australia
Have you tried Squirrelmail's purge function?

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: very large mailbox crashes hmailserver
PostPosted: 2008-05-06 23:02 
Developer

Joined: 2003-11-21 01:09
Posts: 6274
Location: Sweden
Sounds like I need to try huge mailboxes a bit more. :(

I'm not really sure which option is best. One is maybe to set up a new account, connect to both the old and new account using an email client, then drag and drop messages over from the old account to the new one (the messages which you want to keep). When that's done, delete the old account, recreate it and copy back the messages.

However, deleting the account containing >600 000 messages may take some time. It's possible to delete messages manually, for example using:

Code:
select accountid from hm_accounts where accountaddress = '<insert-address-here>'
delete from hm_messages where messageaccountid = <result-of-first-query>


After that, you need to manually delete his account folder as well, which I suspect may take quite some time if you're using Windows Explorer.

In version 5 there will be an option in hMailServer administrator to delete specific IMAP folders.


Top
 Profile  
 
 Post subject: Re: very large mailbox crashes hmailserver
PostPosted: 2008-05-07 18:14 
Moderator
User avatar

Joined: 2005-03-13 05:42
Posts: 1331
Location: Sydney Australia
It sounds to me his account is "full". If you look at his account in hMs admin if he has a (insert own numbers here) 15 gig limit and he tries to delete 5 gig then he will run into trouble. try increasing his account to 30 gig until he deletes his mail.

This is just a guess.

Michael

_________________
hMailServer 5.3.2 B1769 external MySQL 5.1
Win 2003 SP2 | IIS 6 | ClamAV 0.96.2 (tBB) | PHP 5.3.2 | Roundcube Webmail SVN 3815


Top
 Profile  
 
 Post subject: Re: very large mailbox crashes hmailserver
PostPosted: 2008-05-07 20:05 
New user
New user

Joined: 2007-10-15 21:06
Posts: 11
Sorry for the delayed response. I haven't done anything yet -- I had to schedule time to get onto his machine.

@mattg -- yes. That was my intention when setting up squirrelmail in the first place, and unfortunately, it seems to do the same thing as thunderbird when I set it to empty the trash at exit: it kicks off a mysql-nt.exe and hmailserver.exe cpu-hog fest, then about 10 minutes later, hmailserver.exe crashes

@martin -- thanks -- that's exactly what I was going to try to do next. ...and when deleting a folder structure like that, I always drop to a cmd prompt -- "rm . /s" is your friend. Will post results back here. Incidentally (and not to hijack this topic myself), but how come the switch from open source in 4.x to closed in 5.x?

@slug -- there is no quota on his account, so this isn't it. It really appears to be an hmailserver/mysql interaction of some sort, but I don't fancy myself a DBA, so I can't point directly at it.


Top
 Profile  
 
 Post subject: Re: very large mailbox crashes hmailserver
PostPosted: 2008-05-08 04:17 
New user
New user

Joined: 2007-10-15 21:06
Posts: 11
OK, done.

Whenever you see something like this when it comes to deleting anything in sql:

(583256 row(s) affected)

...it's a bit scary. This, however, only took about 20 seconds, and mysql-nt.exe only took 75 to 90% CPU during that time.

...but doing 'rd . /s' on 583,257 files taking up over 16GB was cathartic. It took 50 minutes.

Suggested steps for anyone else having to do this:
0) copy the mail to a new temporary account like martin says
1) stop the hmailserver service
2) do the mysql steps martin says to do
3) turn off realtime filesystem protection for your antivirus (secure your machine another way while doing this...)
4) drop to a cmd prompt and run rd /s on the appropriate mail folder -- USE CAUTION not to hose your system. I am not liable for any damage or loss. Bill Gates is.
5) restart any antivirus you may have stopped
6) start hmailserver service
7) delete the account you just removed all content from
8) recreate the account
9) copy the mail from the secondary temp account (from step 0) back to the first
a) verify it's as it should appear
b) delete the secondary temp account

At this point, thunderbird still works like a champ, and outlook finally takes 15 seconds to check all subscribed folders instead of taking forever and crashing.

THANK YOU to all that responded...!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 4 guests



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group