Operators

The match operator determines the type of comparison that is made between the message characteristic and the test expression. The match operator determines the nature of the data that should be entered as the test expression.

The available match operators are either strings and lists or numerical expressions, depending on the nature of the message characteristic being tested. For example, if the test analyzes the size of a message component, the operator list contains numerical expressions. If the test analyzes the text of a message, the operator list contains string and list expressions.

Depending on the selected operator, different types of text boxes are displayed for entering test expressions. For example, selecting the Is a member of match operator causes the display of a drop-down list from which you can select a policy test expression list. Selecting Matches regex reveals a text box where a regular expression is entered as the test expression. Selecting Is under reveals a text box where a number can be entered.

Match Operators - Strings and Lists

  • Contains: Compare the selected message characteristic with the specified test expression; perform the action if the test expression occurs within the message characteristic.
  • Does not contain: Compare the selected message characteristic with the specified test expression; perform the action if the test expression does not occur within the message characteristic.
  • Is: Compare the selected message characteristic with the specified test expression; perform the action if the test expression is an exact match.
  • Is not: Compare the selected message characteristic with the specified test expression; perform the action if the test expression is not an exact match.
  • Matches: Match using wildcards. The "?" character matches against any single character; the "*" character matches any group of characters. The rule is true if the test expression matches the message characteristic.
  • Does not match: Match using wildcards. The "?" character matches against any single character; the "*" character matches any group of characters. The rule is true if the test expression does not match the message characteristic.
  • Is a member of: Compare the message characteristic to items in the specified list; perform the action if the message component is found in the list.
  • Is not a member of: Compare the message characteristic to items in the specified list; perform the action if the message component is not found in the list.
  • Matches regex: Compare the message characteristic to the specified regular expression; perform the action if it matches. For example, a regular expression can be used to test the contents of a message's Envelope to field. When regular expressions are used in policy rule tests or actions, they are not prefixed or suffixed with slashes or braces. However, if you are manually editing the policy script on the command line, you must "escape" backslashes and quotes within regular expressions by preceding them with a backslash. (The PureMessage Manager automatically escapes these characters.) For example:
    • Correct:
      if (header "foo" :re "bar") if (header "content-type" :re
                                      "text\\/plain")
    • Incorrect:
      if (header "foo" :re "/bar/") if (header "content-type" :re
                                      "text\/plain")
    See the Regular Expression Primer Overview for more information on using regular expressions within the PureMessage policy.
  • Does not match regex: Compare the message characteristic to the specified Regular Expression; perform the action if it does not match. When regular expressions are used in policy rule tests or actions, they are not prefixed or suffixed with slashes or braces. You must escape backslashes and quotes with a backslash character. See Matches regex, above, for examples on using regular expressions within policy tests. See the "Regular Expression Primer" for more information on using regular expressions within the PureMessage policy.

Match Operators - Numbers

Numerical operators compare the numerical value of the specified message characteristic to the number entered in the expression text box. The numerical operators are greater than (>), greater than or equals to (>=), less than (<), and less than or equals to (<=).

When analyzing the size of message components, the default unit of measure is bytes. To analyze size based on a different unit of measure, append "K" (kilobytes), "M" (megabytes) or "G" (gigabytes) to the number entered in the test expression text box.