If you want to delete many messages, via the webmail interface or mail client, then such operation can be time-consuming. This process can be improved by using a tool available through cPanel.
How to delete emails older than?
In order to remove messages older than a certain date or period, from a given mail directory (e.g. Received, Recycle Bin, Sent, and other user directories)
- Log in to Your cPanel account.
- Scroll to Email section and click on "Email Disk Usage".
- On the new page we select an email account for which we will delete messages.
- Then click on "Manage" in the mailbox folder line, you want to clear out.
- In the new area that will appear, choose one of the way of cleaning e-mails from the dropdown menu:
- 1 year old or more - all emails older than a year will be deleted,
- 30 MB in size or more - all emails that are larger than 30 MB will be deleted,
- Previously viewed - all emails that have been viewed will be deleted,
- All Messages - all emails will be deleted,
- Custom Query ... - all emails will be deleted, according to the query. With this option an additional field "Dovecot Query ..." appears, for entering your own query.
Examples of custom queries: savedbefore 1hour
- deleting emails older than 1 hour,savedbefore 2weeks
- deleting emails older than 2 weeks,savedbefore 4weeks
- deleting emails older than 4 weeks (month),savedbefore 108weeks
- deleting e-mails older than 2 years.
- In order to start cleaning, click "Delete Permanently".