6.6  Rules for incoming messages

6.6.1  Creating or changing a rule
6.6.2  Out of office

Rules for sorting and filtering mail at the server can be defined using Kerio Outlook Connector (the same rules that can be defined in the Kerio WebMail interface ).

Warning

After installation of the Kerio Outlook Connector, it will not be possible to use the standard MS Outlook's dialog for administration of rules for incoming mail and alerts Rules and alerts (under Tools → Rules and alerts).

Use the special dialog in the root folder options to create rules for incoming messages (right-click the Kerio root's → Kerio Properties folder).

Rules for incoming messages

Figure 6.15. Rules for incoming messages


Root folder options include several tabs. Open the Rules (see figure 6.15  Rules for incoming messages). The tab includes rules defined. You can enable or disable rules using appropriate matching fields. Mark any rule to view detailed information about this rule in the Rule description window.

Rules are tested from the top downwards. You can use the Up and Down buttons to move rules within the list.

The following buttons and functions are available:

The Rules tab may include two predefined rules which cannot be edited as described below. These rules are the Spam and Out of office rules.

The Spam rule moves any messages recognized by the server as spam to the Spam folder. If this rule is existing, it was created by the Kerio Connect administrator while creating the user account. To set this rule, go to the Tools → Options → Spam menu. To learn more on this rule and related spam topics, refer to chapter 6.7.1  The Spam tab.

The Out of office rule provides automatic answers to email messages where the recipients are absent to do it by themselves. This rule can be set in Tools → Options → Out of office. For details on this topic, see chapter 6.6.2  Out of office.

6.6.1  Creating or changing a rule

Use the New or the Modify button to open the Rule Editor dialog which includes the following sections:

Rule Editor

Figure 6.16. Rule Editor


  1. Select the conditions for your rule — conditions that must be kept so as the email administration meets this rule. One or more conditions from this list can be selected:

    Where the recipient (To or Cc) line contains address

    The To or the Cc (Copy To) entry includes defined string.

    Where the From line contains address

    The From entry contains the string.

    Where the To line contains address

    The To entry contains the string.

    Where the Cc line contains address

    The Cc (Copy To) entry contains the string.

    Where the Sender line contains address

    The Sender entry includes the string. This entry is often contained in messages sent automatically (mailing lists, etc.) where it stands for the From entry.

    Where the Subject contains specific words

    The Subject entry contains defined string(s).

    Kerio Connect spam filter can be set so that the Subject entry will include results of antispam tests (the value is represented by asterisks). Using this feature spam may be filtered easily. Simply insert the number of asterisks that will specify the rule. Messages that match this rule will accept this specification.

    Where the message has an attachment

    At least one attachment must be appended to the message.

    Where the message size is more/less than size

    The message size exceeds the specified value. To specify the size you can select from the following units: bytes (B), kilobytes (KB) and megabytes (MB).

    Where the message was detected as a spam

    Spam are undesirable messages sent to users. You can use the Kerio Connect antispam filter to protect your users from such messages. This filter uses special header items which include message evaluation and information about applied antispam testing.

    For all messages

    This rule is valid for all incoming messages.

  2. Select the Actions for your rule — select an action that will be taken for messages matching with condition in section 1

    Move the message to a specified folder

    Move the message to the selected folder (you can choose a folder from a list). You can also specify shared or public folders in one of the following forms: ~user/shared_folder or #public/public_folder if the appropriate user has write rights for this folder.

    Warning

    If a folder is renamed that a rule is created for, name of the folder in the rule is not changed. Therefore, it is necessary to do this manually.

    Forward the message to an address

    Forward to a specified address. In this case no other actions are performed.

    Reject message (return to sender)

    The message will not be stored in a local mailbox and the user will never be informed about it.

    Keep in Inbox

    This action must be combined with another (i.e. with Move, Forward, Reject, etc.). It cannot be combined with the Discard the message action.

    Discard the message

    The message will not be stored in any local folder. This action cannot be combined with the Keep in INBOX action.

    Send notification

    Sends notification (i.e. a short text message) to a specified address, typically to a cellular phone. It is necessary to define even cellular phones by email addresses, for example .

    The following macros can be used in the message text:

    • $from$ — the notification will show the message sender or the address contained in the From field.

    • $from-name$ — the notification will show the name of the message sender.

    • $subject$ — the notification will show the message subject.

    • $text$ — the notification will show the message text. Only the first 128 characters will be displayed. To reduce the number of displayed characters, edit the macro as follows: $text[50]$ (the number in brackets represents the maximum number of characters displayed in the notification).

    Send autoreply

    The automatic reply with a specified text. The automatic reply will be sent to each sender's address only once a week (so that the automatic reply does not create a loop in case there is an automatic reply set at the other end).

    Stop processing more rules

    If the message complies with this rule, no more rules will be processed. Using this function a user can create more complex rule systems for individual condition types. Rules are tested rule by rule from the top downwards.

    Note

    Notifications and autoreplies are protected from loops. This means that the system does not send a notification in reply to received notification or automatic replies. The detection of notification or automatic replies is performed using special items in the message header. Only notifications and automatic replies generated by Kerio Connect are detected.

  3. Rule description — description of the rule function (it is generated automatically according to the rule definition). Highlighted entries are interactive — click them to set other parameters.

    Select People

    Figure 6.17. Select People


    Click on the Options button to open the Rule Condition Options dialog — see above.

    is

    The entry must exactly match with the specification.

    is not

    The entry must not match with the specification.

    contains

    The entry must contain the (sub)string.

    does not contain

    The entry must not contain the specified (sub)string.

    matches

    The entry must match the expression (the expression can contain the ? and * wildcards that can represent one or more characters).

    does not match

    The entry must not match the expression.

    Rule Condition Options

    Figure 6.18. Rule Condition Options


    Note

    If more than one condition is defined, an appropriate logical operator must be used (and — both conditions must be met, or — at least one of the conditions must be met).

Example: You intend to create a rule that would drop all messages incoming from the spam.com domain which often sends undesirable messages (spam).

  1. Select the Where the line From contains condition in the first dialog section.

  2. Select the Discard the message option in the second section.

  3. Select the contains option in the third section and specify the domain name (spam.com).

  4. Enter a name for the rule (i.e. Drop all messages from the spam.com domain).

6.6.2  Out of office

A special rule for automatic replies can be set on the Out Of Office tab in Tools → Options. This rule can be used when a user is not available in the office for a certain time. Enable the rule and specify the message that will be used as an automatic reply.

Warning

Before enabling the Out of office rule, it is recommended to enable also the Spam rule to make sure that automatic replies are not sent to spammers. If the Spam rule is not enabled, your address will be exposed to spammers who try to send their spam messages to randomly generated addresses and later use those addresses from which they get an answer (so that they are sure the address exists and start to send even larger volumes of spam messages to it).

The Out of office tab

Figure 6.19. The Out of office tab


Note

The I'm out of office rule beats the rules for incoming messages (see chapter 6.6.1  Creating or changing a rule). If the filter includes a rule which sends automatic replies, the action set in this rule will not be taken.

The I'm out of office rule consists of the following items:

  • Condition: The rule will apply to all incoming messages except email sent from mailing lists. The automatic answer is not sent where answering to another automatic email (this should prevent users from email loops).

  • Action: The text entered will be sent to each sender's address included in an incoming message once a seven days.

If the rule is enabled (i.e. the I'm out of office option is on), a question whether the automatic replies would be on or off is issued (see figure 6.20  Possible cancellation of the Out of office rule) upon each startup of MS Outlook. In this case it is supposed that once you run MS Outlook, you are not out of office any more and you are now able to reply to your email. This feature also ensures that you do not forget to turn the rule off once returned to the office.

Possible cancellation of the Out of office rule

Figure 6.20. Possible cancellation of the Out of office rule