Filters are normally edited in the user interface, in the window that appears when the File→Filters command is run. Once defined, they are applied server-side by manitou-mdx to messages that enter the database.
A filter is defined to apply to incoming or outgoing mail or both. Applying a filter consists of evaluating its condition, and if the result is true, doing the actions that are associated to it. If a filter has no action, it can be considered inactive. A condition is basically an expression that evaluates to true or false, optionally qualified with a unique name, that can be self-contained or refer to another expressions.
The expressions can be arbitrarily complex, with subparts combined with NOT, OR, AND boolean operators, references to other expressions, calls to built-in functions and evaluation of built-in operators. An expression may be named and refered to by its name from another expression.
expr := expr op expr expr := (expr) expr := NOT expr op := OR | AND | contain[s] | eq[uals] | regmatches | ne expr:= function(expr)
As of 0.9.11, built-in functions are:
These are examples of expressions that can be used in a filter (the filter actions being triggered when the expression evaluates to true).
header("From") contains "@dom.tld" OR header("To") contains "@dom.tld"
header("X-Spam-Flag") eq "YES"
header("List-Post") eq "<mailto:firstname.lastname@example.org>"
header("subject") eq "Your Bugzilla buglist needs attention." AND header("From") eq "email@example.com"