Sieve filters: semantics of multiple scripts

Since multiple Sieve scripts  can apply to each recipient and different scripts can produce different results, there has to be a way to resolve conflicting results. The rules for determining the final result are:



 The scripts associated with a particular recipient are scanned in order from most specific to most general. The result of the most specific script that executes an action which determines the status of a message is used preferentially. The actions that determine the status of a message are: 

 , 

 , 

 , 

 , 

 , and 

 (Messaging Server 7.0 or later). 



</li>

 A set of special, nonstandard actions are provided which, if used, work the other way around: the most general script that specifies them is used preferentially. These special actions are: 

 (like discard) and </li>

 (like reject) </li>

</ul>

</li>

 A Sieve script marked with the (new in 8.0)  action becomes the Sieve determining the disposition of a message. If multiple Sieve scripts are marked, then the most general Sieve script "wins". (Thus this is a generalization of the " " and " " sorts of effects -- but in addition to being able to combine " " with " " to obtain a " " effect, or " " with  " " to obtain a " " effect, " " may also be combined with actions such as " " or " ".) </li>

 " " actions in system-level Sieve scripts are executed  unconditionally, regardless of whether or not the Sieve script that contains the  " " action is selected as the one which determines message handling for this recipient. </li>

 Conversion tags set or added by the " " and " " actions,  respectively, are processed unconditionally in a fashion similar to " " actions. </li>

 An error in any Sieve script forces a " " action and aborts further scanning. Additionally, a notification message is sent to the Sieve script owner reporting  the problem. </li>

</ol>

Prior to the 7.0 release, " " actions were only available to system-level Sieve scripts, and " ", when used, forced the return of a  5yx response to the DATA command in SMTP. In 7.0 and later this is no longer the case: " " now behaves like " ", making it possible for it to apply to only a subset of all recipients. However, the MTA checks and whenever possible will continue to use a 5yz response whenever it is possible to do so.

See also:
 * Sieve capture extension
 * Sieve filters: types of scripts
 * Sieve conversiontag extensions
 * Sieve capture extension
 * Sieve override extension
 * Notification message types
 * Sieve filter interpretation MTA options
 * Sieve filters: evaluation of multiple scripts
 * Sieve hierarchy