Updated: May 7, 2024
Discover how to delete / purge emails older than a certain date, complete with syntax examples and configuration tips.
Solution
Using the below purge commands will result in data removal. To avoid any data loss we strongly suggest that a full backup of the domain / account, on which the purge will be applied, should be performed before performing the purge procedure.
To use the purge commands, connect to the CLI interface:
<login> user admin
<password> admin_user_pa$$w0rd
For a list of available commands, type HELP
+OK: Authentication successful
<#>
Here, in the general context you have the command:
If you use the command at this level it will apply the purge on all the enabled domains and their accounts.
Example of running the command:
This will remove all the emails with the internal date older than three weeks.
You can also use this command at domain level, thus applying the command for all accounts in only that domain or at account level, thus applying the purge for that specific account.
Notes:
-
There are some implicit constraints, applied by default, that are meant to prevent any accidental data loss. Any purge condition you use for this command will be applied after a logical & (AND) is made with the following implicit conditions:
Purge folders = (Spam Trash)
Purge condition = (BEFORE 2w)
These can be edited on a domain level via the CLI domain context:<#> update domain domain.test
<domain#> config adminlimitsand the commands:
SET [purgeConstraint <search criteria>] - set the implicit purge condition constraint
SET [purgeFolders (list of purgeable folders)]
-
In any context of the CLI interface, you can type help to obtain a list of all the available commands.