In Kerio Connect, you can create your own antispam rules. The rules filter email headers or email bodies.
To create custom rules for spam control, go to Configuration > Content Filter > Spam Filter > Custom rules.
Creating custom rules
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 messages as non-spam or rejects it, Kerio Connect stops processing the remaining rules.
- In the administration interface, go to Configuration > Content Filter > Spam Filter > Custom rules.
- Click Add.
- In the Add Rule dialog, type a name for the rule.
- Select Mail header or Mail body filter.
- Type the string you want to filter. You can use:
- Any text
*
to represent any number of characters?
to represent a single character- Regular expressions (mail body only)
- 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.
NOTE
To decrease the load on your server, place the From
and To
header rules at the top. If Kerio Connect rejects messages using this rule, no other antispam or antivirus tests are performed on these messages.
Example for regular expressions
You want to block all messages that contain the word cialis
.
Use regular expressions to exclude words containing the substring cialis, such as specialist, socialist.
- In Configuration > Content Filter > Spam Filter > Custom rules, click Add.
- Select Mail body and type the following regular expression:
/\bcialis\b/i
- Select Treat the message as spam and reject it.
- Click OK.
From now on, Kerio Connect rejects all messages that include cialis
as a single word.
For detailed information on regular expressions, see the SpamAssassin wiki page.
NOTE
Regular expressions combined with *
and ?
wildcards do not work with contains substring (see the screenshot below).
Defining actions for custom rules
If your custom rule rejects a message, Kerio Connect can:
- Send a bounce message to the sender — We do not recommend this option because spammers usually fake addresses, so your bounce message will be undeliverable.
- Forward the message to a quarantine address — We recommend this option so that important messages are not falsely identified as spam.
You can select these option in Configuration > Content Filter > Spam Filter > Custom rules under the list of your custom rules.
NOTE
To decrease the load on the server, Kerio Connect can reject messages during the SMTP session.
To enable rejection during the SMTP session, select Reject messages as soon as possible....
However, Kerio Connect cannot now perform the two actions described above.