Sieve is a programming language that can be used to create filters for email.
Sieve is a programming language that can be used to create filters for email. It owes its creation to the CMU Cyrus Project, creators of Cyrus IMAP server.
The language is not tied to any particular operating system or mail architecture. The current version of Sieve's base specification is outlined in RFC 5228, published in January 2008.
Sieve differs from traditional programming languages in that it is highly limited – the base standard has no variables, and no loops, preventing runaway programs and limiting the language to simple filtering operations. Although extensions have been devised to extend the language to include variables and, to a limited degree, loops, the language is still highly restricted, and thus unsuitable for running user-devised programs as part of the mail system.
There are also a significant number of restrictions on the grammar of the language, in order to reduce the complexity of parsing the language, but the language also supports the use of multiple methods for comparing localized strings, and is fully Unicode-aware.
The scripts are transferred to the mail server in a server-dependent way. The ManageSieve protocol (defined in RFC 5804) allows users to manage their Sieve scripts on a remote server. Mail servers with local users may allow the scripts to be stored in e.g. a .sieve file in the users' home directories.