Creating custom rules for spam control in Kerio Connect

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.

  1. In the administration interface, go to Configuration > Content Filter > Spam Filter > Custom rules.
  2. Click Add.
  3. In the Add Rule dialog, type a name for the rule.
  4. Select Mail header or Mail body filter.
  5. 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)
  1. 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
  1. 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.

  1. In Configuration > Content Filter > Spam Filter > Custom rules, click Add.
  2. Select Mail body and type the following regular expression: /\bcialis\b/i
  3. Select Treat the message as spam and reject it.
  4. 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.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring spam control in Kerio Connect

Antispam methods and tests in Kerio Connect To detect and eliminate spam, Kerio Connect uses...

Kerio Anti-spam filter

NOTE Changed in Kerio Connect 9.2.0! The Kerio Anti-spam extension uses the Bitdefender...

Configuring greylisting

To fight spam more efficiently, Kerio Connect supports greylisting. Greylisting is an...

Blocking messages from certain servers

Automatically blocking or allowing messages from certain servers In Kerio Connect you can...

Configuring Caller ID and SPF in Kerio Connect

Caller ID and SPF (Sender Policy Framework) allow you to filter out messages with fake sender...