Sieve relational extension

RFC 5231 (Sieve Email Filtering: Relational Extension)adds relational operators to Sieve conditional tests such as " ", " ", and " ". The capability identifier is " ": require "relational"; Relational adds the " " match-type permitting counting the number of entities, and the " " match-type permitting numeric  comparisons of the following forms: :value "gt" :value "ge" :value "lt" :value "le" :value "eq" :value "ne" As of MS 8.0.1.3, the MTA allows :count to be combined with other match-types in header and address tests. When this is done the test performs the non-count match first, counting the number of matches. The resulting count is then compared with a third argument. An "i;ascii-numeric" comparator is always used for this second match.

For example, the following test checks to see if the domain "example.com" appears in more than five Received: fields and holds the message if it does: if header :count "gt" :contains "received" "example.com" "5" {hold;} Note that the address test counts addresses, not fields. For example, the following test checks to see if there are less than 10 addresses that have a subdomain of example.org as their domain in a recipient field: if address :count "lt" :matches :domain &#x5b;"to", "cc", "bcc"&#x5d; "&#x2a;.example.org" "10" {...}

See also:
 * Sieve supported extensions