Previous Topic: Complex True-False TestNext Topic: Complex Composite True-False Test


Composite True-False Test

You can combine multiple commands using AND, OR and NOT operators. For example, you can combine multiple msgattr commands to detect messages that exceed a maximum size or where the number of recipients exceeded a maximum limit. You can even link totally disparate commands. This is particularly useful if you want to combine different types of Data Lookup command. All in cases, the syntax is:

[NOT] (CMD1) AND|OR [NOT] (CMD2) [AND|OR [NOT] (CMD3)]

Where (CMDn) is a complete, self-contained userattr, mapi or msgattr data lookup command.

For example, you can combine Message Attribute and Address Book lookup commands to block e-mails sent to the La Paz or Lima offices unless the total message impact is less than 5MB. The syntax is:

NOT (msgattr WHERE msgimpactkb < 5000)
AND (mapi WITH any %recipient% WHERE Office CONTAINS ANY {"La Paz","Lima"})

The following is another example of a composite True-False test. It uses the positive operator IS with two sub-commands.

(mapi with %sender% where dept IS "sales") AND (userattr with %recipient% where position IS "manager")

If there is one sender and three recipients, this command requires the following three lookup operations, each containing two sub-operations:

((mapi with oabassi@unipraxis.com where dept IS "sales") AND 
(userattr with srimmel@unipraxis.com where position IS "manager")) 
OR
((mapi with oabassi@unipraxis.com where dept IS "sales") AND 
(userattr with lsteel@unipraxis.com where position IS "manager")) 
OR
((mapi with oabassi@unipraxis.com where dept IS "sales") AND 
(userattr with fschaeffer@unipraxis.com where position IS "manager"))

For any lookup operation to be true, both its sub-operations must be true. For example, for the first lookup operation to be true, Omar must be in the Sales department and Spencer must be a manager.

For the test itself to be true, only one of the three lookup operations needs to be true.

More information:

Address Book Lookup

Message Attribute Lookup