Start a conversation

Deleting Old Mails using Items Clean-Out Feature

Overview

Administrators can configure the Items Clean-Out feature which performs automatic user mailbox cleanup older than a specified time period, i.e. 30 days, to save space on the datastore disk.

Kerio Connect mailserver process runs the email account cleanup periodically based on message store size. Autodelete Clean-Out mails can be applied to Trash, Spam, Sent, and All folders (except Contacts and Notes).

The Item Clean-Out is looking at the date of the mails modification/manipulation, i.e. the timestamp when the email was moved to the folder, not the Creation date.

Please note that items subjected to the Items Clean-Out feature are permanently deleted, so the Deleted Items Recovery feature will not works against cleaned out items.

 

Solution

If you do not want to lose any messages with this clean-out, then archive or backup the datastore first and only then proceed further.

Access to Kerio Connect Administration is required to make any changes

To configure the clean-out feature, multiple settings can be modified as per your requirement:

Per-Domain Settings

  1. In the administration interface, navigate to the Configuration > Domains section.
  2. Double-click on a domain.
  3. On the Messages tab, choose the folders for automatic clean-out and set the number of days.
  4. Click OK.

    cleanout.png

 

Per-User Settings

By default, new users inherit settings from their domain. To change the settings for individual users, follow the steps mentioned below:

  1. In the administration interface, navigate to the Accounts > Users section.
  2. Double-click on a user.
  3. Navigate to the Messages tab.
  4. In the Items Clean-Out section, select the Use custom settings for this user option.
  5. Select the folders for automatic clean-out and set the number of days.
  6. Click OK.

    334.png

 

Folder Limit Settings

This works like a scheduled task and does not clean all relevant items at once. By default, it is set up to clean-out only 1000 items per folder at once, so that server performance is not affected. Therefore, the actual clean-out can take a while for large email folders. The steps to change this limit are outlined below:

  1. Stop the Kerio Connect server (Windows / macOS/Linux)
  2. Navigate to the Kerio Connect installation folder. The defaults are: 

    • Windows: C:\Program Files\Kerio\MailServer
    • macOS: /usr/local/kerio/mailserver

    • Linux: /opt/kerio/mailserver

  3. Open the mailserver.cfg file.
  4. Navigate to the <table name="MessageStore"> section.

  5. Change the value (1000 in the example below) of the variable AutoDeleteFolderLimit, as shown in this example:

    autodeletefolder.png

  6. Start the Kerio Connect server (Windows / macOS/Linux)

Note: If the increase in limit leads to server performance issues, you must revert it to the default state.

 

If after some time/days, you are observing that emails are still not being deleted as per the updated settings, then the next option is to restart the server, which runs the clean-out script when it starts up. When this action happens, the Operations logs would contain entries with the label:

{DELETE} Protocol: SYSTEM, User: $cleanout_agent

 

Testing

 Emails are being autodeleted based on the specified/updated time period.

 

Back to Top

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted
  3. Updated

Comments