Sieve supported extensions

In addition to the core Sieve functionality specified in RFC 5228 (Sieve), the MTA&#x27;s Sieve implementation supports a great many standardized extensions, plus many additional private-to-the-MTA extensions. Standardized extensions supported include:



 Body extension (RFC 5173). The body test provides the means to test material in the message body. Note that there are are number of restrictions on the implementation of body. (7U2) 

 Copy extension (RFC 3894). Copy is a simple extension that allows the " "  and " " actions to be used without canceling the default action of saving the message to the "inbox". (6.1) 

 Date extension (RFC 5260). The date test provides the means to test fields in date-time values. (7U4) 

 Editheader extension (RFC 5293). The " " and " " actions provide the ability to alter the message header. As of MS 8.1.0.1, the " " action has been extended to allow glob-style wildcards in the field name. (Obviously this capability should be used with great care, as not only does it make it possible to delete entire swathes of header information, it also is an expensive operation to perform. In particular, leading wildcards in the field name should be avoided if at all possible.) Additionally, the " " action described in draft-degener-sieve-editheader-00 has been implemented. This provides an especially convenient way to add tags to subject fields. 

 Encoded-character extension (RFC 5228). This extension provides a way to specify Unicode characters by numeric value in Sieve character strings. Additionally, \r, \n, and \t can be used to represent carriage return, line feed, and tab characters respectively in quoted strings. (7.0) 

 Envelope extension (RFC 5228). This extension consists of an " " test that can access MAIL FROM and RCPT TO address information. (Other extensions have made additional items available to the " " test.) 

 Envelope-dsn (RFC 6009). This extension provides access to additional envelope information provided by the delivery status notification SMTP extension. (7U2) 

 Environment extension (RFC 5183). Environment provides scripts access to information outside of the current message. (7.0U1) </li>

 Ereject extension (RFC 5429). This extension updates the definition of the " " action to allow messages to be refused during the SMTP transaction (rather than being accepted and then generating an  MDN), and defines the  " " action to require messages to be refused during the SMTP transaction. (6.1) </li>

 Extlists extension (RFC 6134). This extension adds the " " match-type to the  " ",  " ", " ",  " ",  " ",  " ",  " ",  " ",  " ", " ",  " ", and  " "  tests. " " in turn allows the test to check values against externally stored information. (7U1) </li>

 Fcc extension (draft-ietf-extra-sieve-fcc-02.txt). This extension adds support for delivering a copy of any generated message to the  and   actions to the mailbox specified by a :fcc nonpositional parameter. </li>

 Fileinto extension (RFC 5228). This extension adds the " " action for specifying a folder where the message is to be delivered. </li>

 Ihave extension (RFC 5463). " " makes it possible to write scripts that use a given extension if it is available but continue to operate if it is not. (7.0) </li>

 Index extension (RFC 5260). The index extension adds a " " nonpositional parameter to the address, date, and header tests, which in turn provides the means to check a specific instance of header fields that occur multiple times. (7U4) </li>

 Imap4flags extension (RFC 5232). Imap4flags provides the means to set IMAP flags on messages delivered to the message store. (6.3P1) </li>

 Mime extension (from RFC 5703). The " " extension provides facilities for testing headers in inner MIME parts of messages. (7U1) New in MS 8.0 is support for the " " and " " Sieve extensions from RFC 5703. New in MS 8.1 is the ability to control whether or not the foreverypart Sieve control looks inside of nested messages or treats them as leaf parts. The  argument tells foreverypart to look inside and is the default. causes nested messages to be treated as leaf parts. (8.0, 8.1) </li>

 Notify extension (RFC 5435) and the mailto notification method (RFC 5436). Notify with the mailto method provides the means to send an notification email about the current message being processed. Note that an earlier draft of the " " action is also still supported. (6.2, 7.0.5) </li>

 Relational extension (RFC 5231). Relational adds relational comparisons (less than, greater, than, etc.) to the " ",  " ", and  " "  tests (and other extension tests as they have subsequently been defined). It also adds the ability to count (" ") the number of entities that match the test criteria (6.0). As of MS 8.0.1.3, :count may also be used as a modifier to other match types in header and address tests to count and test the number of matches that occurred. </li>

 Redirect-dsn extension (RFC 6009). This extends Sieve&#x27;s " " action  to provide control over delivery status notification parameters with two new arguments " " ("  support was actually added for 6.3p1, prior to its standardization) and " ". (6.3p1, 7U2) </li>

 " ", " ", and " " extensions (RFC 5235). The tests defined by these extensions provide a means for Sieve scripts to access spam and virus filter "scores". (" " and " " 6.0; " " 6.3) </li>

 Subaddress extension (RFC 3598). Subaddress " " and " " tagged arguments for the  " " and " " tests to access  information  embedded in the local part of an address. (iMS uses a plus sign  as the separator between user and detail information in the local part.) (6.0) </li>

 Vacation extension (RFC 5230). The " " action defined by this extension can be used in user-level Sieve scripts to generate "out of office" messages in response to incoming email. </li>

 Vacation-seconds extension (RFC 6131). This extends the vacation time to allow specification of timeout values in seconds rather than minutes; in particular, it adds a " " parameter to the " " action. </li>

 Variables extension (RFC 5229). The core Sieve language does not provide any means of saving state from one statement to the next. This extension adds variables to the language. (6.2) </li>

</ul>

In addition to the above standardized extensions, the MTA also supports some private extensions:

<ul>

<li> The " " test supports a private " " tag. 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. (7.0.5) </li>

<li> The " " test supports two new, private, part modifiers,  " " and " ". The " " modifier causes the " " test to operate on the display-name phrase; note that the display-name phrase is the optional text appearing outside of and specifically in front of the actual address, the actual address being the part enclosed in angles. The " " modifier causes the " "  test to operate on any parenthetical comments that appear after an address. (7.0.5) </li>

<li> The " ",  " ", and " " actions allow operating on the MTA&#x27;s private conversion tag mechanism. (" " and " " 6.0; " " 7.0u3) Also, in system-level Sieves, the " " test accepts  " " as a field specifier value,  checking the current list of conversion tags, one at a time. (This test only "sees" the set of conversion tags that were present prior to Sieve processing; the effects of " " and " " are not visible.) (6.3) </li>

<li> The " " and  " " actions are available for adding a string argument as  text at the beginning or end, respectively, of the first plain text part of a message. (7.0u3) </li>

<li> The  action provides a convenient way to add a prefix string, that is, a "tag",  to the beginning of the Subject: header line. (6.0) </li>

<li> The " " action is available for system Sieve filters to manipulate any of the eight signed, 64 bit counters accessible from Sieve filters. (8.0) </li>

<li> The " " action (and the deprecated synonym  " "). Two optional nonpositional parameters, " " and " ", were added for MS 6.3; " " (to generate Microsoft® Exchange "envelope journaling" format) was added for 7.0u2; " " (which can be used as a modifier with either  or  ) was added for 8.0. (6.3, 7.0u2, 8.0) </li>

<li> In addition to standard Sieve comparators, the MTA also supports some non-standard Sieve comparators. </li>

<li> The " " action takes a string argument, and makes that string available for logging to a debug log file  if MTA debugging is enabled at   level or higher. </li>

<li> The MTA supports the proposed Sieve duplicate extension specified in RFC 7352. (8.0) </li>

<li> The    extension adds a " " part to the   test, providing access to the SMTP AUTH value. </li>

<li> The " " action  causes a message to be sidelined in the MTA queue area as a   file. </li>

<li> The " " test and  " "  action allow multiple Sieve scripts to cooperate in making a determination of a message&#x27;s importance, much like the way that the  " " and " " extensions allow multiple Sieve scripts to cooperate in determing whether or not a message is spam. </li>

<li> The " " action  causes a message to be unconditionally discarded; this is a "non-overridable" discard (for use by system-level Sieve scripts). </li>

<li> The " " construct  is supported in system-level Sieve scripts. (7.0.5) </li>

<li> The " " operator permits querying and updating a memcache server from Sieve scripts. (8.0) </li>

<li> The " " operator permits querying and updating MeterMaid from Sieve scripts. (8.0) </li>

<li> The " " action  is supported in system-level Sieve scripts; the capability string is " ". (8.0) </li>

<li> The " " action is supported in system-level Sieve scripts. It suppresses all uses of the " " and  " " extensions (all applications of either form of the " " action). (8.0) </li>

<li> The " " action is  supported in system-level Sieve scripts. (6.1) </li>

<li> By default, the MTA supports a relaxed use of " " clauses in Sieve scripts, in that the MTA permits " " clauses to be sprinkled throughout a Sieve script (rather than, as the Sieve standard specifies, having all " " clauses at the beginning of the Sieve script). This is especially useful in conjunction with the MTA&#x27;s support for combining multiple Sieve scriptlets such as those resulting from spam/virus filter package integration, or from user LDAP attribute   settings. However, enforcement of per-the-Sieve-standard " " clause location may be selected by setting the  MTA option. </li>

<li> The " " and " " modifiers defined for the " " test may now also be used in " " and  " " tests. Similarly to when used with " ", the " " modifier specifies that MIME decoding should be performed; in the case of " " and " " tests, the MIME processing in question is the decoding of MIME encoded-words (see RFC 2047 for the definition of encoded-words). " " is the default for " " and " " tests on " " and " " address parts. " " is the default for other sorts of " " tests. (7.0.5) </li>

<li> The proposed " " extension adds a " " match type. (6.1) </li>

<li> The " " and " "     arguments are supported on the  Sieve " " action,  for controlling    whether Sieve " " actions cause addition of    Resent-&#x2a; header lines. (6.3p1) </li>

<li> The " " and " " parameters are supported on the  Sieve " " action,  to control whether or not the original message&#x27;s envelope From address is used on the redirected message (vs. using the Sieve owner&#x27;s address as the envelope From address for the redirected message). (6.3p1) </li>

<li> The " "  action, to override a message&#x27;s original envelope From address, is available for use in system-level Sieves. (8.0) </li>

<li> The " "  action is available for system-level Sieves. It accepts a single integer or string argument and sets the current          MT-PRIORITY to the argument value. This action is only allowed in          system-level Sieves and the argument must be in the -9 to 9 range           of valid MT-PRIORITY values. (8.0) </li>

<li> The " "  and " " actions are available in system-level Sieves. (7.0u1) </li>

<li> The " " action  is available for system-level Sieves, to set the enqueue operation mode to  " ", " ", " ", or " ". (8.0) </li>

<li> The " "  action is available for system-level Sieves, to set an   effective message processing priority. It takes a single string argument which must be one of " ", " ", or " ". Note that this priority      is NOT stored in the message header and only affects processing at this       particular stage of message transfer. If multiple " " actions       are specified in different system-level Sieves, the one in the most       specific Sieve wins. (7.0u4) </li>

<li> The " " and " " actions are supported; they tell the MTA how to set the spam or virus score which  a standard " " and  " " test, respectively, would then test. (6.0) </li>

<li> The " " function takes as an argument an integer value n specifying the number of bytes of (cryptographically strong) random material to return. " " is permitted only in system-level Sieves; (attempts to use " " from user-levels Sieves are prohibited because of performance concerns). </li>

<li> The " " function takes as an argument an integer specifying an upper limit n on the range of values to return; a uniformly distributed random number between 0 and n-1 is then returned. The linear congruential generator described in "Random Number Generators: Good Ones Are Hard To Find", S. Park and K. Miller, CACM 31 No. 10, pp. 1192-1201, October 1988 is used to generate these numbers; a separate sequence seeded from the system time is used for each sieve evaluation. An explicit 32 bit integer seed can be specified by calling the " " function. (This may be useful for debugging purposes.) A value of 0 will cause the sequence to be reinitialized from the system clock. </li>

<li> <span id='Sieve_transactionlog_extension'> The " " action is available for system-level Sieves. It takes a single string argument. All of the " " actions in all of the applicable Sieves are concatenated into a single string, which is then available for inclusion in the MTA message transaction log file; see the  MTA option. (8.0) </li>

<li> The  function is available, to convert a string from one charset to another. (8.0.1) </li>

<li> The  action is available, to cause additional text to be added to the " " clause in the   field of the MTA message transaction log file. (8.0) </li>

<li> Custom tests may be defined via MTA   mapping tables. (Updates to MS 6.2 and updates to MS 6.3) </li>

<li> Subroutines are supported. (8.0) </li>

<li> Trailing commas are now allowed in string lists. (8.1.0.1) </li>

</ul>

Finally, one of the most important of the MTA&#x27;s extensions to Sieve is the MTA&#x27;s support of a hierarchy of Sieve filters.

See also:
 * Sieve address test
 * Sieve body extension
 * Sieve copy extension
 * Sieve discard and jettison actions
 * Sieve date and index extensions
 * Sieve duplicate extension
 * Sieve editheader extension
 * Sieve envelope extension
 * Sieve environment extension
 * Sieve ereject and reject and refuse extensions
 * Sieve external lists
 * Sieve fileinto action
 * fileinto Option
 * Sieve ihave extension
 * Sieve imap4flags extension
 * Sieve mime extension
 * Sieve notify extension
 * Sieve override extension
 * Sieve redirect action
 * Sieve relational extension
 * Sieve spamtest and virustest extensions
 * Sieve subaddress extension
 * Sieve vacation extension
 * Sieve variables extension
 * Conversion tags
 * Sieve conversiontag extensions
 * Sieve addprefix and addsuffix extensions
 * Sieve addtag extension
 * Sieve adjustcounter extension
 * MTA counters
 * Sieve capture extension
 * Sieve comparators
 * Sieve hold extension
 * Sieve importance extension
 * Sieve loop extension
 * Sieve memcache extension
 * Sieve metermaid extension
 * MeterMaid
 * strict_require MTA Option
 * Sieve regex extension
 * Job Controller priority-based processing
 * Sieve setenvelopefrom extension
 * Sieve setnotify and setreturn extensions
 * Sieve setoperation extension
 * Sieve setpriority and setmtpriority extensions
 * Sieve transactionlog extension
 * Sieve translate extension
 * Sieve warn extension
 * Sieve custom tests via mappings
 * Sieve subroutines
 * Sieve expressions
 * Sieve filters: semantics of multiple scripts
 * Sieve hierarchy
 * Sieve language extension MTA options
 * Sieve language
 * Random number generation