User Guide

9-29
AsyncOS 9.1.2 for Cisco Email Security Appliances User Guide
Chapter 9 Using Message Filters to Enforce Email Policies
Message Filter Rules
message, and “false” if it is not found. For example, the following example checks to see if the header
X-Sample is found, and if its value contains the stringsample text”. If a match is made, the message
is bounced.
You can specify non-ASCII characters to search for in the value of the header.
The following example demonstrates the header rule without a comparison. In this case, if the header
X-DeleteMe is found, it is removed from the message.
When working with headers, remember that the current value of the header includes changes made
during processing (such as with filter actions that add, remove, or modify message headings). See
Message Header Rules and Evaluation, page 9-5 for more information.
Random Rule
The random rule generates a random number from zero to N-1, where N is the integer value supplied in
parenthesis after the rule. Like the
header() rule, this rule may be used in a comparison, or may be used
alone in a “unary” form. The rule evaluates to
true in the unary form if the random number generated
is non-zero. For example, both of the following filters are effectively equal, choosing Virtual Gateway
address A half the time, and Virtual Gateway address B the other half of the time:
FooHeaderFilter:
if (header('X-Sample') == 'sample text')
{
bounce();
}
DeleteMeHeaderFilter:
if header('X-DeleteMe')
{
strip-header('X-DeleteMe');
}
load_balance_a:
if (random(10) < 5) {
alt-src-host('interface_a');
} else {
alt-src-host('interface_b');
}