Generated by GPT-5-mini| Sieve (mail filtering language) | |
|---|---|
| Name | Sieve |
| Paradigm | Declarative |
| Designers | Michael Baentsch, Cyrus SASL contributors |
| First appeared | 2001 |
| Latest release | RFC 8974 (2020) |
| Influenced by | Procmail, MIME |
Sieve (mail filtering language) Sieve is a specialized mail filtering language standardized for server-side message processing, designed to let users specify actions for incoming mail on Internet Message Access Protocol servers, Post Office Protocol servers, and Mail Delivery Agent backends. It emphasizes a simple, declarative syntax and safety for unattended execution on systems managed by organisations such as Cyrus IMAP and Dovecot, and is governed by specifications published through the Internet Engineering Task Force.
Sieve provides a minimal, extensible rule language for matching and delivering electronic mail by criteria such as envelope attributes, header fields, and body content, enabling actions like filing to mailboxes, adding flags, redirecting to mailing lists, or rejecting with bounce messages; it integrates with delivery infrastructures like Postfix, Exim, Sendmail, qmail, Courier Mail Server, and Microsoft Exchange gateways. The language avoids Turing-completeness to reduce risks discussed by operators at organisations including CERN, MIT, and NASA, and aligns with policy models from standards bodies such as the Internet Engineering Task Force and the Internet Society.
Work on Sieve began in the late 1990s amid debates at the Internet Engineering Task Force about safe mail filtering following practices in tools like Procmail and implementations at Carnegie Mellon University and Harvard University. Early design contributors included engineers associated with Cyrus IMAP and implementers from Sendmail, Inc. and Apple Inc.; the initial specification was published as an RFC to formalise behavior across diverse Mail Transfer Agent and Mail Delivery Agent deployments. Successive RFCs refined authentication, internationalisation, and extension mechanisms in response to operational experience from deployments at University of Cambridge, RIPE NCC, Deutsche Telekom, and other major providers.
Sieve adopts a declarative, rule-based model with statements like "if", "elsif", "else", and actions such as "fileinto", "redirect", and "reject"; control structures are intentionally minimal to satisfy administrators at organisations including Google, Yahoo!, and Microsoft. The language specifies test primitives for headers, envelope, and body parts, with matching algorithms influenced by predecessor tools such as Procmail and formats like MIME. Sieve scripts are parsed and executed by servers such as Cyrus IMAP and Dovecot that enforce resource constraints and capability negotiation protocols defined for interoperability with services like SMTP relays and IMAP clients.
The base Sieve specification and its extensions are documented in a series of RFCs produced through the Internet Engineering Task Force process, including work items that address authentication via SASL, internationalisation with UTF-8, vacation auto-replies, and advertisement of capabilities through LMTP and IMAP commands. Notable RFCs were authored and reviewed by contributors affiliated with Oracle Corporation, Mozilla Foundation, Cisco Systems, and independent experts from University College London and ETH Zurich. Extension mechanisms allow third parties such as Mozilla and Kolab Systems AG to add tests and actions while preserving safety properties required by providers like FastMail and Rackspace.
Sieve is implemented in a broad range of server and client ecosystems: core implementations exist in Cyrus IMAP, Dovecot, Courier Mail Server, and integrations for Postfix via LMTP, while graphical and web-based management interfaces have been provided by projects such as Roundcube, SquirrelMail, Mailpile, and commercial offerings from Rackspace and FastMail. Enterprise and academic deployments span institutions including University of Oxford, ETH Zurich, NASA, and multinational carriers such as Deutsche Telekom and NTT Communications. Client-side adapters and libraries for languages like Python, Perl, Ruby, and Java facilitate automation in environments maintained by teams at companies such as Google and Facebook.
Common Sieve use cases include automated sorting for mailing lists, auto-responses for leave notifications, spam quarantine routing, and header-based routing for shared inboxes used by teams at organisations like BBC, The New York Times, and Bloomberg. Example patterns demonstrate tests on headers like "From" and "Subject", actions to file into mailbox folders, and conditional redirection to helpdesk systems or external mailing lists such as those hosted by GNU Project sites. Administrators in enterprises and non-profits often combine Sieve scripts with upstream spam filters from vendors such as SpamAssassin and Barracuda Networks to implement multilayered delivery policies.
Sieve's design intentionally omits looping constructs and arbitrary I/O to reduce risks identified by security teams at CERT, NIST, and several Computer Emergency Response Team chapters; capability negotiation and permission models limit script effects in multitenant deployments run by providers like Amazon Web Services and Microsoft Azure. Limitations include restricted body inspection depth relative to full-text indexes used by Elasticsearch and bounds on execution time and memory that can affect complex matching; these constraints reflect trade-offs similar to those discussed in RFC debates involving contributors from IETF Sieve Working Group, University of Cambridge, and Cyrus IMAP implementers.
Category:Email