How to periodically delete all mails saved on all mailbox?

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
black zero
Normal user
Normal user
Posts: 111
Joined: 2008-08-01 15:26

How to periodically delete all mails saved on all mailbox?

Post by black zero » 2012-11-30 09:30

I don't want to go through all accounts one by one and click 'empty account' on each and every account. >.>

User avatar
mattg
Moderator
Moderator
Posts: 21103
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: How to periodically delete all mails saved on all mailbo

Post by mattg » 2012-11-30 10:48

Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

black zero
Normal user
Normal user
Posts: 111
Joined: 2008-08-01 15:26

Re: How to periodically delete all mails saved on all mailbo

Post by black zero » 2013-01-23 09:07

The script works. The problem is (I'm using script for one account only for test), in a very large mailbox, it doesn't wipe everything within range (e.g older than one day mail).

Example, 10.000 mails older than one day. Script runs. It wipes out only 10%. Sometimes 30% of 10.000 mails.

Help?

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: How to periodically delete all mails saved on all mailbo

Post by Bill48105 » 2013-01-23 10:52

black zero: Make sure you are using one of the UPDATED scripts! The early ones used incremented counter which skipped messages because as messages deleted the message counters changed. The updated (corrected) ones decremented the counter which solves that problem. I'm guessing that's what you're seeing perhaps.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Post Reply