Overview
You have a number of emails filling your mail queue that you want to remove, such as in situations of spam emails from a compromised account or bounced emails. You have attempted to clear the queue from the UI, but want a more direct method of resetting the queue to remove all these invalid or undesired emails.
Solution
In situations where the mail queue has become unmanageable due to a large batch of undesired emails, they can negatively impact performance, resulting in freezes or preventing legitimate email flow. In these situations, the messages can be manually cleared directly from the filesystem.
Note: The steps below do not help mitigate the underlying cause of the increased message queue. Be sure to address the root cause of the issue before clearing the queue to prevent the issue from reappearing. If you suspect a potential Spam situation, see Detecting Compromised Servers Used for Spamming.
- Stop the Kerio Connect Service.
- Navigate to the
/store/queue
directory.- Default Windows path:
C:\Program Files\Kerio\MailServer\store\queue
- Default Linux path:
/opt/kerio/mailserver/store/queue
- Default macOS path:
/usr/local/kerio/mailserver/store/queue
- Default Windows path:
- Create a new sub-directory with any name except "pickup", e.g. "example.old".
- Note: The “pickup” folder name is reserved and may already exist in your environment:
- Move all of the numeric folders within the queue directory (except the pickup folder) into the new sub-directory that you created.
- Note: The folders could also be deleted, but keeping them in a directory within the message queue folder is a way to have them backed up in case any of the messages that were stuck are needed, or for the purpose of re-insertion back in the queue. If you are making this change due to a potential Spam attack, be careful to fully review any emails for potential Spam before reinserting them into the queue.
- Start the Kerio Connect Service.
- Note: If you encounter an issue with the Kerio Connect Service not starting, restart the whole server machine.
Testing
After restarting the server, return to the Message Queue and confirm that no further spam or bounced emails are appearing and mail flow resumes normally.