The Email Rules Protocol enables the client/server interaction that allows a messaging system to implement automatic message processing (message rules (4)). This protocol provides a specific mechanism through which the server and the client can implement a flexible message processing system. Mail delivery is a complex operation that allows the server and the client to implement their own additional processing that is not covered by this protocol.
Rules (4) are sets of conditions and associated actions (3) that enable a user to automatically organize, categorize, and act on messages as the messages are delivered to a folder. Rules can be set on any server folder (either public folders or private folders).
Rule (4) evaluation is triggered when e-mail messages are delivered in a user's mailbox or when messages are first saved to a public folder. The clauses in a condition in a rule (4) are evaluated against the properties of the incoming message. If the condition evaluates to "TRUE", the rule (4) actions (3) are executed either by the server or by the client. If all actions (3) in a rule (4) can be executed by the server, the rule (4) is said to be a server-side rule. If any action (3) cannot be executed by the server (for example, the server doesn't have access to user's personal message store; therefore, it has to defer to the client any action (3) moving messages to a personal message store), the rule (4) has to be executed by the client, and it is said to be a client-side rule.
Server-side rules are handled entirely by the messaging server, independent of the state of the client. Client-side rules do not execute until the client connects to the particular message store on the server. For each message that needs to be acted on by the client as a result of a client-side rule, the server will create a message called Deferred Action Message (DAM) in a special folder called the Deferred Action Folder (DAF) as described in [MS-OXOSFLD].
All enabled rules (4) in a folder are evaluated in sequential order, one by one, until all rules (4) in the rules table for the particular folder have been evaluated. If the conditions of a particular rule (4) are met, its associated set of actions (3) is executed. If a rule (4) is an "exit level" rule (4) (according to a flag in the rule (4) state property) and the rule (4) condition is met, then the evaluation of subsequent rules (4) is canceled. Otherwise, evaluation of the next rule (4) continues even if a rule (4) action (3) moves the message, in which case the remaining rules (4) continue to run against the moved message.
If the rule (4) action is to copy or move a message to a server folder, the server will verify the existence of the destination folder. If the destination folder also has rules (4) (this is not common), the server will evaluate the destination folder rules (4) against the moved message after evaluating the remaining rules (4) in the original folder. If the destination folder does not exist, the server will create a Deferred Error Message (DEM) in the DAF, and the client will display an error when it processes the DEM.
When a folder is deleted, all rules (4) set on that folder are also deleted.
This protocol enables two slightly different types of rules (4): standard rules, which are more commonly used, and extended rules, which provide greater storage capacity, but for performance reasons, the server can choose to limit their usage. The way the two types of rules (4) are created and modified differs, but they are processed identically by the server and by the client.
The following subsections describe the main components covered in this protocol.