A rule consists of a regular expression and an action. When an email comes in, the engine checks the first rule if its regular expression matches the sender's email address. If it matches the expression, the selected action for the rule is applied. If it does not match, the next rule is checked. If there is no match, the default action is applied.