Page 1 of 1

delete all mail from all mailboxes

Posted: 2008-05-08 14:09
by LezM
Hi

I am new here and new to hmail, can someone please assist in pointing me to the easisest way to del all mail from all mailboxes. I am setting up a backup server that extracts mail from my live box, but I don't want to accumilate these mails on the backup server.

Appreciate your help! - LezM

Re: delete all mail from all mailboxes

Posted: 2008-05-08 14:39
by mattg
Test this idea first, but...

Un-install hmailserver, delete the C:\program files\hmailserver\data\ directory, reinstall hmailserver.
Settings and .ini should be untouched. With a new installation you can then restore a backup, but only restore domains and accounts and settings not messages.

Matt

Re: delete all mail from all mailboxes

Posted: 2008-05-08 15:24
by Kaan1983
I'd write a script getting messageIDs from DB and deleting via API one by one

Re: delete all mail from all mailboxes

Posted: 2008-05-08 15:50
by LezM
mattg wrote:Test this idea first, but...

Un-install hmailserver, delete the C:\program files\hmailserver\data\ directory, reinstall hmailserver.
Settings and .ini should be untouched. With a new installation you can then restore a backup, but only restore domains and accounts and settings not messages.

Matt
Thanks, Matt - tried this but it still holds "mailbox size" in memory!

LezM

Re: delete all mail from all mailboxes

Posted: 2008-05-08 15:51
by LezM
Kaan1983 wrote:I'd write a script getting messageIDs from DB and deleting via API one by one
This will be too time consuming - to many email accounts!

LezM

Re: delete all mail from all mailboxes

Posted: 2008-05-09 00:57
by minsik
LezM wrote:
mattg wrote:Test this idea first, but...

Un-install hmailserver, delete the C:\program files\hmailserver\data\ directory, reinstall hmailserver.
Settings and .ini should be untouched. With a new installation you can then restore a backup, but only restore domains and accounts and settings not messages.

Matt
Thanks, Matt - tried this but it still holds "mailbox size" in memory!

LezM

do you need to run the dbsyncronise program in the

C:\Program Files\hMailServer\Addons\DataDirectorySynchronizer ?

Re: delete all mail from all mailboxes

Posted: 2008-05-09 11:32
by LezM
Tried running it, but it still does not clear the mailbox size - report reads"skipped...mailbox that has mail

Re: delete all mail from all mailboxes

Posted: 2008-05-09 13:51
by Kaan1983
LezM wrote:
Kaan1983 wrote:I'd write a script getting messageIDs from DB and deleting via API one by one
This will be too time consuming - to many email accounts!

LezM
You'd be done by now. :|

Re: delete all mail from all mailboxes

Posted: 2008-05-09 17:53
by LezM
:) Yep, but I am setting up a backup server...this will continuosly fetch mail from my main server, just as a backup. The reason for deleting emails is so that I can delete them about once a week, so if there is a need to run the backup server, there will not be a huge lot in the mailboxes. Makes sense?

Re: delete all mail from all mailboxes

Posted: 2008-05-09 22:50
by Kaan1983
I'd still go for coding :) (and a stored procedure)

Re: delete all mail from all mailboxes

Posted: 2008-05-10 10:37
by LezM
But Hmail has this feature in v4.4 ...as shown in the search index, where you can delete all undelivered mail, but this feature does not show any emails in que, although there are mails in the mailboxes! and selecting "clear" que does nothing!