Sieve date and index extensions

As of Messaging Server 7.0u4, the MTA supports the Sieve date and index extensions defined in RFC 5260 (Sieve Email Filtering: Date and Index Extensions). (Note that prior to Messaging Server 7.0u4, certain parts of these extensions, notably the " " test and parts of the " " test, had already been made available.)   The " " test matches dates off header lines; the " " test matches the current time (the time at which the Sieve script is evaluated); and the " " extension adds " " and " " arguments to the " ",  " ", and " " tests. The capability strings are " " (which enables both " " and " " tests) and " ": require &#x5b;"date","index"&#x5d;; Some examples of " " or " " use: require &#x5b;"date", "vacation", "relational"&#x5d;; if anyof(currentdate :is "day" "05",             currentdate :is "day" "10",              allof(currentdate :is "weekday" "2", currentdate :value "gt" "14", currentdate :value "lt" "22")) { vacation "I&#x27;m working at the hospital today"; redirect "hospital-address"; } require &#x5b;"date", "relational", "vacation"&#x5d;; if allof(currentdate :value "ge" "date" "2007-06-30",         currentdate :value "le" "date" "2007-07-07") { vacation :days 7 "I&#x27;m away during the first week in July."; } require &#x5b;"variables","date","relational"&#x5d;; set "startDateTime" "2007-01-18T00:00:00Z"; set "endDateTime" "2007-01-19T00:00:00Z"; if allof(currentdate :value "ge" "iso8601" "${startDateTime}",        currentdate :value "le" "iso8601" "${endDateTime}") { redirect "user+wherever@domain.com"; } Note that " " and " " by default returns time values in the server local time zone, meaning that  ISO 8601 strings such as   may be returned. Alternatively, one may use &#x27; &#x27; in the test to force  shifting (conversion) of the original  time zone to the specified time zone prior to performing the test. In contrast, specifying " " for a " " test forces use and retention of the time zone offset originally present.

The Sieve extlists extension, among other things, also adds a " " match type to the " " and " " tests.  When considering " ", note that as of Messaging Server 7.0.5 the MTA supports a private " " tag on Sieve address tests. This " " tag accepts a positive integer as an argument. If " " is specified, then only the th address in each header field will be tested. Note that " " (selecting which address out of multiple addresses) may be combined with " " (selecting which header line out of multiple header lines), to cause the test to operate on a single address in a single header line.

See also:
 * Brief overview of Sieve language elements
 * Sieve vacation extension
 * ISO 8601 format
 * Sieve address test
 * Sieve external lists
 * Sieve supported extensions