3.2.5.1 Processing Incoming Messages to a Folder

When a message is either delivered to a private mailbox folder or posted to a public folder, the messaging server SHOULD evaluate the rules (2) that apply to the folder where the message was delivered. If a rule (2) moves the message to a folder where a different set of rules (2) exist, the server applies rules (2) recursively on the incoming message before executing any subsequent rules in the original folder.

A server can restrict the number of extended rules it executes on a folder.<14> The server can also restrict the maximum size, in bytes, that the user is allowed to accumulate for a single extended rule by setting the PidTagExtendedRuleSizeLimit property ([MS-OXCSTOR] section 2.2.2.1.1.1) on the Logon object. If the PidTagExtendedRuleSizeLimit property is set and the size of the PidTagExtendedRuleMessageCondition property (section 2.2.4.1.10) exceeds the value specified by the PidTagExtendedRuleSizeLimit property, the server MUST return an error.

For each message delivered to a folder, the server evaluates each rule (2) in that folder in increasing order of the value of the PidTagRuleSequence property (section 2.2.1.3.1.2) in each rule (2). If two or more rules (2) have the same value for the PidTagRuleSequence property, the order in which the server evaluates these rules (2) is not defined.

The server MUST only evaluate rules (2) that are enabled; that is, rules (2) that have the ST_ENABLED flag set in the PidTagRuleState property (section 2.2.1.3.1.3).

The server MUST evaluate rules (2) that have the ST_ONLY_WHEN_OOF flag set in the PidTagRuleState property only when the mailbox is in an OOF state as specified in [MS-OXWOOF] section 2.2.4.2.

When executing a rule (2) whose condition evaluates to "TRUE" as per the restriction in the PidTagRuleCondition property (section 2.2.1.3.1.9), then the server MUST either perform the actions (2) specified in the PidTagRuleActions property (section 2.2.1.3.1.10) associated with that rule (2) (in the case of a server-side rule) or generate a DAM for the client to process as specified in section 3.2.5.1.2. Following is a description of what the server does when it executes each action (2) type, as specified in section 2.2.5.1.1, for an incoming message:

  • "OP_MOVE": The server MUST place a copy of the message in the folder specified in the action buffer structure and delete the original message; if multiple "OP_MOVE" operations apply to the same message, the server SHOULD create multiple copies of the message and then delete the original message.

  • "OP_COPY": The server MUST place a copy of the message in the folder specified in the action buffer structure.

  • "OP_REPLY": The server MUST use properties from the reply template (for example, body text properties, recipients (2) on the template) and from the original message (for example, the sender of the message) to create a reply to the message and then send the reply. The server MUST NOT send a reply if the PidTagAutoResponseSuppress property ([MS-OXOMSG] section 2.2.1.77) on the message has the 0x00000020 bit set. For more details on suppression of automatic replies, see [MS-OXCMAIL] section 2.2.3.2.14. The server MAY also avoid sending replies to automatically generated messages, which are identified by the PidTagAutoForwarded property ([MS-OXCMSG] section 2.2.1.20), to avoid generating endless autoreply loops.

  • "OP_OOF_REPLY": The server MUST behave as specified for the "OP_REPLY" action (2). In addition, the server SHOULD set the value of the PidTagMessageClass property ([MS-OXCMSG] section 2.2.1.3) on the reply message to "IPM.Note.rules.OOFTemplate". This message class value is a prefix, and the client can append a client-specific value at the end; for example, a client can instead request that the server set the value of the PidTagMessageClass property in this circumstance to "IPM.Note.rules.OOFTemplate.Microsoft".<15> The server MUST NOT send a reply if the PidTagAutoResponseSuppress property on the message has the 0x00000010 bit set. For more information on suppression of automatic replies, see [MS-OXCMAIL] section 2.2.3.2.14.

  • "OP_DEFER_ACTION": The server MUST generate a DAM as specified in section 3.2.5.1.2. The server MUST also set the PidTagHasDeferredActionMessages property (section 2.2.9.1) to "TRUE" on the message.

  • "OP_FORWARD": The server MUST forward the message to the recipients (2) specified in the action buffer structure. The server SHOULD NOT<16> forward messages that were forwarded to the sender.

  • "OP_DELEGATE": the server MUST resend the message to the recipients (2) specified in the action buffer structure. The server also MUST set the values of the following properties to match the current user's properties in the address book:

    • The PidTagReceivedRepresentingEntryId property ([MS-OXOMSG] section 2.2.1.25) MUST be set to the same value as the mailbox user's PidTagEntryId property ([MS-OXOABK] section 2.2.3.3).

    • The PidTagReceivedRepresentingAddressType property ([MS-OXOMSG] section 2.2.1.23) MUST be set to the same value as the mailbox user's PidTagAddressType property ([MS-OXOABK] section 2.2.3.13).

    • The PidTagReceivedRepresentingEmailAddress property ([MS-OXOMSG] section 2.2.1.24) MUST be set to the same value as the mailbox user's PidTagEmailAddress property ([MS-OXOABK] section 2.2.3.14).

    • The PidTagReceivedRepresentingName property ([MS-OXOMSG] section 2.2.1.26) MUST be set to the same value as the mailbox user's PidTagDisplayName property ([MS-OXCFOLD] section 2.2.2.2.2.5).

    • The PidTagReceivedRepresentingSearchKey property ([MS-OXOMSG] section 2.2.1.27) MUST be set to the same value as the mailbox user's PidTagSearchKey property ([MS-OXCPRPT] section 2.2.1.9).

    • The PidTagDelegatedByRule property ([MS-OXOMSG] section 2.2.1.84) MUST be set to "TRUE".

  • "OP_BOUNCE": The server SHOULD<17> send a reply message to the sender detailing why the sender's message couldn't be delivered to the user's mailbox; the original message SHOULD NOT<18> appear in the user's mailbox.

  • "OP_TAG": The server MUST set on the message the property specified in the action buffer structure.

  • "OP_DELETE": The server MUST delete the message. The server MUST stop evaluating subsequent rules (2) on the message except for Out of Office rules.

  • "OP_MARK_AS_READ": the server MUST set the MSGFLAG_READ flag (0x00000001) in the PidTagMessageFlags property ([MS-OXPROPS] section 2.792) on the message.

If the server fails to execute a rule (2) action (2), the server MUST generate a DEM as specified in section 3.2.5.1.3.

The server MUST place all DAMs and DEMs that it creates as a result of running any rule (2) in any folder into the DAF.