#rev 2020-09-10 gfreudig == The Sieve language == Sieve mail filtering was introduced in the D-ITET mail system with the commissioning of the new mail system on linux servers in January 2017.<
><
> The Sieve mail filtering language [[https://tools.ietf.org/html/rfc5228|(RFC 5228)]] is a special data-driven language that is optimized to allow efficient server-side filtering of mails. A sieve mail filtering script can be installed from the user and is executed on the mail server at delivery of the mail to the user mailbox. Sieve is a modern alternative to the cryptic language of procmail filter scripts.<
><
> The IETF Sieve working group has brought the following extensions to the base specification: * '''Body''' – allows a script to test the body of a message, not just its header. [[https://tools.ietf.org/html/rfc5173|(RFC 5173)]] * '''Variables''' - allows the script to save and retrieve values in variables. [[https://tools.ietf.org/html/rfc5229|(RFC 5229)]] * '''Vacation''' - specifies an action to send a response informing the sender that the recipient may be away. [[https://tools.ietf.org/html/rfc5230|(RFC5230)]] * '''Relational tests''' - defines numeric tests, so that a script may test a field for a numeric value, and may test against the number of occurrences of a field. [[https://tools.ietf.org/html/rfc5231|(RFC 5231)]] * '''IMAP4flags''' - allows a script to test and set a message's IMAP flags. [[https://tools.ietf.org/html/rfc5232|(RFC 5232)]] * '''Subaddress''' - allows a script to test subaddresses of the form "`user+detail@domain.example`". [[https://tools.ietf.org/html/rfc5233|(RFC 5233)]] * '''Spamtest''' and Virustest - allows a script to interface with implementation-dependent message filtering. [[https://tools.ietf.org/html/rfc5235|(RFC 5235)]] * '''Date and Index Extensions''' [[https://tools.ietf.org/html/rfc5260|(RFC 5260)]] * '''Editheader''' - allows a script to add and delete message header fields. [[https://tools.ietf.org/html/rfc5293|(RFC5293)]] * '''Reject''' - allows messages to be rejected at either the LMTP/SMTP level or with an MDN or DSN. [[https://tools.ietf.org/html/rfc5293|(RFC 5293)]] * '''Notifications''' - allows a script to trigger external notifications of email. [[https://tools.ietf.org/html/rfc5435|(RFC 5435)]] * '''E-mail notifications''' - specifies notifications via e-mail. [[https://tools.ietf.org/html/rfc5436|(RFC 5436)]] * '''XMPP notifications''' - specifies notifications via XMPP. [[https://tools.ietf.org/html/rfc5437|(RFC 5437)]] * '''Checking''' - Mailbox status and accessing mailbox metadata. [[https://tools.ietf.org/html/rfc5490|(RFC 5490)]] * '''MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure''' [[https://tools.ietf.org/html/rfc5703|(RFC 5703)]] == Managesieve == In modern mail systems the user has no longer file system access to any directory on the imap mail server. Therefore the user must be able to remotely manage his serverside sieve script. Managesieve is the solution to this task. It's a management protocol specification (RFC 5804) over which the sieve script can be manipulated remotely with a management service running on the imap server. All sieve plugins for webmailer/email programs and standalone client sieve editor programs are based on the Managesieve protocol.