Overview
Sieve is a scripting language used to filter and modify email messages. It provides a flexible and powerful way to manage email messages by automatically filtering, sorting, and transforming them based on a wide range of criteria. Rather than relying on a proprietary DSL, Stalwart Mail Server uses Sieve as its default scripting language primarily because it is sufficiently powerful to handle most filtering tasks and is an established internet standard.
A typical Sieve script consists of one or more rules, each consisting of a test and an action. The test checks a specific attribute of the message, such as the sender's address or the subject line, while the action specifies what to do with the message if it matches the test. This manual does not cover how to write Sieve scripts but tutorials and examples can be found at http://sieve.info.
The Sieve interpreter included in Stalwart Mail Server supports the following extensions:
- RFC 5228 - Sieve: An Email Filtering Language
- RFC 3894 - Copying Without Side Effects
- RFC 5173 - Body Extension
- RFC 5183 - Environment Extension
- RFC 5229 - Variables Extension
- RFC 5230 - Vacation Extension
- RFC 5231 - Relational Extension
- RFC 5232 - Imap4flags Extension
- RFC 5233 - Subaddress Extension
- RFC 5235 - Spamtest and Virustest Extensions
- RFC 5260 - Date and Index Extensions
- RFC 5293 - Editheader Extension
- RFC 5429 - Reject and Extended Reject Extensions
- RFC 5435 - Extension for Notifications
- RFC 5463 - Ihave Extension
- RFC 5490 - Extensions for Checking Mailbox Status and Accessing Mailbox Metadata
- RFC 5703 - MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure
- RFC 6009 - Delivery Status Notifications and Deliver-By Extensions
- RFC 6131 - Sieve Vacation Extension: "Seconds" Parameter
- RFC 6134 - Externally Stored Lists
- RFC 6558 - Converting Messages before Delivery
- RFC 6609 - Include Extension
- RFC 7352 - Detecting Duplicate Deliveries
- RFC 8579 - Delivering to Special-Use Mailboxes
- RFC 8580 - File Carbon Copy (FCC)
- RFC 9042 - Delivery by MAILBOXID
- REGEX-01 - Regular Expression Extension (draft-ietf-sieve-regex-01)