Policy Script Syntax Overview
This section introduces the PureMessage policy syntax. Examples in this overview use pseudocode to best describe policy syntax structure and generically demonstrate various PureMessage mail filtering scenarios. Specific PureMessage policy syntax is discussed later in PureMessage Default Policy Overview.
The PureMessage policy script, called policy.siv, is written using a variation of the Sieve mail filtering language. Sieve is a simple command-based scripting language; its syntax resembles C or Perl, but it has no variables or looping constructs. In its simplest form, a Sieve script is a set of commands executed in a sequence. The commands in the PureMessage policy.siv script can be actions, action modifiers, tests, controls, blocks or comments.
The following example identifies the commands in a policy filter:
# This script performs a virus test.
# Messages containing viruses are filed as SPAM and then quarantined.
if pmx_virus {
pmx_file "SPAM";
pmx_quarantine "Virus";
stop;
}
Description:
- The '#' characters are Sieve comments.
- The if and stop commands are controls.
- The pmx_virus command is one example of many possible tests in PureMessage.
- The '{' and '}' characters delimit blocks.
- The pmx_quarantine and pmx_file commands are PureMessage action
- The "Virus" and "SPAM" strings are action modifiers.
- Actions are delimited with the ';' character.