Overview
In Kerio Connect, you can create your own anti-spam rules to filter email headers or email bodies. You can create as many rules as you like.
Kerio Connect processes the rules in the order they are listed. If the spam filter marks a message as non-spam or rejects it, Kerio Connect stops processing the remaining rules.
Prerequisites
Access to Kerio Connect Administration
Solution
Creating custom rules for spam control
- In the administration interface, go to Configuration > Content Filter > Spam Filter > Custom Rules.
- Click Add.
- In the Add Rule dialog, enter a description for the rule.
- Choose Mail header or Mail body filter. For Mail header select the Type.
Note: the type "contains binary hex string" is used for blocking specific hex strings that may be used to inject malicious code. - Enter the string you want to filter under Contains. You can use:
- Any text.
- * to represent any number of characters.
- ? to represent a single character.
- Regular expressions (mail body only).
For example, if you want to block all messages that contain the wordcialis
:- Choose Mail body and enter the regular expression:
/\bcialis\b/i
- Choose Treat the message as spam and reject it.
- Choose Mail body and enter the regular expression:
- For any message that matches the rule, you can:
- Treat the message as non-spam.
- Treat the message as spam and reject it.
- Add spam score to the message.
- Click OK.
Defining actions for custom rules
If your custom rule rejects a message, Kerio Connect can:
- Send a bounce message to the sender: Not recommended because spammers usually fake addresses, so your bounce message will be undeliverable.
- Forward the message to a quarantine address: Recommended so that important messages are not falsely identified as spam.
You can choose these global options in Configuration > Content Filter > Spam Filter > Custom rules under the list of your custom rules.
Confirmation
From now on, in the example above Kerio Connect rejects all messages that include cialis
as a single word.
Note: custom message rules are stored in mailserver.cfg -> HeaderFilter list. They can be modified manually if needed, but the recommended way of modification is through Webadmin UI.
Important: To decrease the load on your server, place the From and To header rules at the top. If Kerio Connect rejects messages using these rules, no other antispam or antivirus tests are performed on these messages.
Priyanka Bhotika
Comments