Previous Topic: Mailbox Rule Actions

Next Topic: Filter String Object Identifier Restrictions

Pattern Matching in Mailbox Rules

Mailbox rules use regular expressions for pattern matching. Consider the following whitespace characters that apply to regular expressions in mailbox rules:

\t

Specifies a horizontal tab.

\r

Specifies a carriage return character.

\n

Specifies a line feed or new line character.

The characters that represent line breaks in text can vary with the operating system, mail server, and mail client, for example:

In certain circumstances, the mail processing elements of CA SDM exchange or substitute one of these line break characters for another to establish or maintain a distinction between different text elements, such as message text and attached parameters. As a result, when you want to use a line or paragraph break, build your filters so that either \r and \n can be matched, whichever is found. If you want to indicate a line break between two keywords, build your filters so that a sequence of one or more \r and \n characters can be matched.

Line wrapping by the mail client that sends a message can cause unexpected line breaks to appear in the middle of the text which is expected to match your filter string, when the filter string searches the body of the message. A space can change to a carriage return, line feed, or both, or the carriage return, line feed, or both can be inserted after a space. If a message is composed in HTML, and contains bulleted or numbered lists or indented paragraphs, tabs can also be present after the mail client converts and sends the message. When you include spaces in the middle of a filter string, use a Regular Expression block which represents any whitespace of variable size. This block is [ \t\r\n]+ (open-bracket, space, backslash, t, backslash, r, backslash, n, close-bracket, plus sign), and represents any sequence of one or more spaces, tabs, carriage returns, and line feeds.

Example: Use [ \t\r\n] to Match a Keyword Exactly

This example demonstrates how you can use whitespace characters to match the keyword "request" and not match other possible keywords such as the following words:

requester
requesting
requested
orequestra

To match only the keyword request, precede and follow the keyword request by one or more whitespace characters as follows:

[ \t\r\n]request[ \t\r\n]

The Mail Eater matches only the word request or the word as part of a sentence, and not as part of another word such as requester.