Difference between revisions of "List (Sieve test)"

From Mailutils
Jump to navigationJump to search
(Initial revision)
 
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
 
The ''list'' test evaluates to true if any of the headers matches any key. Each header is regarded as a list of keywords. By default, comma is assumed as a list separator. Alternative delimiter can be requested using the <tt>:delim</tt> tag, whose value is a string consisting of valid list delimiter characters.
 
The ''list'' test evaluates to true if any of the headers matches any key. Each header is regarded as a list of keywords. By default, comma is assumed as a list separator. Alternative delimiter can be requested using the <tt>:delim</tt> tag, whose value is a string consisting of valid list delimiter characters.
  
Sample usage:
+
== Sample usage ==
  
 
<source lang="C">
 
<source lang="C">
Line 20: Line 20:
 
     }
 
     }
 
</source>
 
</source>
 +
 +
 +
[[Category:Sieve]]
 +
[[Category:Sieve Tests]]
 +
[[Category:Sieve Extensions]]

Latest revision as of 23:54, 24 December 2010

List is a Mailutils Sieve test. It is implemented as a loadable extension.

Syntax

 list [ COMPARATOR ] [ MATCH-TYPE ]
      [:delim <delimiters: string>]
      <headers: string-list> <key-list: string-list>

The list test evaluates to true if any of the headers matches any key. Each header is regarded as a list of keywords. By default, comma is assumed as a list separator. Alternative delimiter can be requested using the :delim tag, whose value is a string consisting of valid list delimiter characters.

Sample usage

  require "test-list";

  if list :matches :delim " ," [ "X-Spam-Keywords", "X-Spamd-Keywords" ]
                               [ "HTML_*", "FORGED_*" ]
    {
       discard;
    }