User Tools

Site Tools


mdx_filters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mdx_filters [2008/11/27 14:32] – created danielmdx_filters [2012/01/28 02:28] (current) – [Restrictions] daniel
Line 1: Line 1:
 ====== Overview ====== ====== Overview ======
 Filters are normally edited in the user interface, in the window that appears when the File->Filters command is run. 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.
  
 {{:ui-filters-window.png?400}} {{:ui-filters-window.png?400}}
  
-A filter can apply to incoming or outgoing mail or both. Applying a filter consists of evaluating is **expression**, and the result is true, doing the **actions** that are associated to it. If a filter has no action, it can be considered inactive.+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.
  
 ====== Expressions syntax ====== ====== Expressions syntax ======
-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 this name from another expression.+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.
  
 <code> <code>
Line 29: Line 30:
  
 ====== Examples ====== ====== Examples ======
 +
 +These are examples of expressions that can be used in a filter (the filter actions being triggered when the expression evaluates to true).
 +
 +  - From or to any address of a domain (dom.tld): <code>header("From") contains "@dom.tld" OR header("To") contains "@dom.tld"</code>
 +  - Spam detected by spamassassin:  <code>header("X-Spam-Flag") eq "YES"</code>
 +  - From a mailing list: <code>header("List-Post") eq "<mailto:dbd-pg@perl.org>"</code>
 +  - With a specific subject and sender: <code>header("subject") eq "Your Bugzilla buglist needs attention." AND header("From") eq "bugzilla-daemon@domain.tld"</code>
 +
 +
mdx_filters.1227796355.txt.gz · Last modified: 2008/11/27 14:32 by daniel