Rules are the main part of the chainmail configuration file. Rules define which messages chainmail selects for processing and what kind of processing it applies to those messages. Each rule specifies a condition and actions. When an email message matches the condition, the actions are executed. What conditions and actions are supported by chainmail is described further in this document.
Each rule is described by the following construct in the configuration file:
Rule "Name" Flags If Condition Action Actions
Rule is a keyword that begins the rule definition
"Name" is a descriptive rule name. It is optional and can be omittied. If present, it must be a double-quoted string.
Flags are optional flags that can modify the rule's behavior. Currently, only one flag is supported, Continue. Its meaning is as follows. Normally, as soon as chainmail find a matching rule, this rule's actions are executed and no other rule is tried. However, if a rule that matched has Continue flag specified, then the processing continues. Other rules are tried, as if not matching rule were found yet.
If is a keyword that starts condition description. Condition syntax is described in detail further in the section called “Conditions” . You can specify multiple If statments, each followed by a condition. These conditions are AND'ed together.
Action is a keyword that starts action description. Action syntax is described in detail further in the section called “Actions”. You can specify multiple Action statments, each followed by its own action description. The actions are executed in sequence.
Rules are tried in sequence. Whenever a rule's condition matches, rule's actions are executed. If the rule doesn't have the Continue flag specified the processing of the message stops then. If the flag is specified, then processing continues, and other rules are tried.