Message Processing Rules

Purpose of Message processing rules

Message processing Rules allow adjustment of settings used for message processing and message delivery depending on conditions. Each condition checks some of message parameters such as sender and recipient addresses, names of viruses or other threats detected in the message, its size and others. You can also specify different combinations of settings check and thus change the check procedure.

You can specify general Rules for all processed messages as well as Rules connected with certain users, their aliases and groups.

General Rules of message processing are set in the Dr.Web MailD configuration file, in the [Rules] section. Rules of message processing connected with users and user groups are set in the built-in database.

Storing rules in the built-in database is rational if the number of users with individual settings is great and, therefore, processing of Rules in the configuration file becomes inefficient as complexity of rule search is proportional to the number of rules specified in the file. In this case, Rule search in the database is more efficient and, moreover, optimizes memory usage.

Order of message processing and Rule search

When processing a message with a plug-in or another component, it can request a parameter value from MailD core. In this case, the required parameter value is selected according to the following algorithm:

View of Rules in the built-in database that are connected with the message recipient (specified in the RCPT TO).

View of Rules in the built-in database that are connected with all user groups of the recipient. The view is performed in the reverse order: starting from settings of the last user group to the first user group in the list.

View of Rules specified in the [Rules] section.

Note the procedure of Rule search

oAll Rules in the current group are checked in the same order as they are set.

oFor each rule, CONDITION is checked - if the conditional part is true, the required parameter value is searched in the SETTINGS part of the rule.

oIf CONDITION is false, the required value is searched in the next Rule.

oIf CONDITION is true and is followed by a cont directive, search continues in the next Rule. If the true CONDITION is followed by a stop directive, rule search stops regardless whether the required value is found or not.

Parameter value is determined according to the rule search results in the following way:

If the searched parameter is found in one of the matching rules, the value is taken from the SETTINGS part (note that if more than one of the matching Rules contain this parameter, its result value depends on the parameter semantics. For details, see Rule Format and Special Cases).

If no rule is found, no rule is matching or no matching rule contains the searched parameter, its value is taken from the corresponding section of the configuration file.

If the searched parameter is not specified in the configuration file, the default parameter value is taken.

For description of the Rule formats, refer to the Rule Format section.

For description of special cases of Rules (including those with the missing SETTINGS part and Rules that use cloning parameters), refer to the Special Cases section.

For description of how errors are handled and rules are validated, refer to the Error Handling and Rule Validation section.