Skip to main content
Version: 0.16

Overview

Sieve is a scripting language for filtering and modifying email messages. Rather than inventing a proprietary DSL, Stalwart uses Sieve because it is an established internet standard well suited to the range of filtering and transformation tasks encountered in email delivery.

A Sieve script consists of one or more rules, each combining a test and an action. The test inspects an attribute of the message, such as the sender's address or the subject line; the action specifies what to do when the test matches. This documentation focuses on how Sieve is integrated into Stalwart (interpreters, variables, expressions, function reference, examples) rather than on Sieve syntax itself; tutorials covering the language are collected at sieve.info.

Stalwart extends the standard Sieve language with its own expression syntax and a rich set of built-in functions for DNS queries, directory lookups, SQL queries, hashing, image and MIME inspection, and more, all accessible from the eval, let, and while instructions.

The Sieve interpreter included in Stalwart supports the following extensions: