Sieve (mail filtering language)

Sieve (mail filtering language)

Sieve is a language that can be used to create filters for electronic mail. 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. It requires the use of RFC 2822-compliant messages, but otherwise should generalize to other systems that meet these criteria. 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 suitable 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.

Example

This is an example sieve script:


# example script
# de.wikipedia.org
#require ["fileinto", "reject"] ;

# Messages bigger than 100K will be rejected with an error message
#

if size :over 100K { reject "I'm sorry, I do not accept mail over 100kb in size. Please upload larger files to a server and send me a link.Thanks.";}

# Mails from a mailing list will be put into the folder "mailinglist"
#

elsif address :is ["From", "To"] "mailinglist@blafasel.invalid" { fileinto "INBOX.mailinglist";}

# Spam Rule: Message does not contain my address in To, CC or Bcc
# header, or subject is something with "money" or "Viagra".
#

elsif anyof (not address :all :contains ["To", "Cc", "Bcc"] "me@blafasel.invalid", header :matches "Subject" ["*money*","*Viagra*"] ) { fileinto "INBOX.spam";}

# Keep the rest.
# This is not necessary because there is a "implicit keep" Rule

else { keep;}

External links

* [http://sieve.info/ Sieve.Info, a Wiki Site about Sieve]
* [http://web.archive.org/web/20041126062029/http://www.cyrusoft.com/sieve/ The old Sieve Home Page on web.archive.org]
* RFC 5228 (Base Specification about Sieve)
* [http://www.ietf.org/html.charters/sieve-charter.html Sieve IETF Working Group Charter]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • E-mail filtering — Email filtering is the processing of email to organize it according to specified criteria. Most often this refers to the automatic processing of incoming messages, but the term also applies to the intervention of human intelligence in addition to …   Wikipedia

  • Sieve — Sieve  язык описания правил фильтрации для почтовых сообщений. Создан компанией Cyrusoft International, Inc./ISAMET во время работы над почтовым сервером Cyrus (англ.). Содержание 1 История 2 Расширения …   Википедия

  • Sieve — In general, a sieve separates wanted/desired elements from unwanted material using a tool such as a mesh, net or other filtration or distillation methods, but it is also used for classification of powders by particle size, or for size measurement …   Wikipedia

  • Mulberry (e-mail client) — Mulberry Mulberry on Windows XP Original author(s) Cyrus Daboo Stable release 4.0.8 / February 23, 2007; 4 years ago ( …   Wikipedia

  • Apache James — Developer(s) Apache Software Foundation Stable release 2.3.2 / August 2009 Preview release 3.0 M2 / 2010 Written in Java …   Wikipedia

  • RFC 3028 — Sieve: A Mail Filtering Language. T. Showalter. January 2001 …   Acronyms

  • RFC 3028 — Sieve: A Mail Filtering Language. T. Showalter. January 2001 …   Acronyms von A bis Z

  • DBMail IMAP and POP3 server — Developer(s) NFG Net Facilities Group and others Stable release 2.2.17 / 2010 09 01 Preview release 2.3.6 / 2009 06 28 Operating system …   Wikipedia

  • Cyrus IMAP server — Developer(s) Carnegie Mellon University Stable release 2.4.10 / July 5, 2011; 4 months ago (2011 07 05) …   Wikipedia

  • Internet Message Access Protocol — Fonction Consultation de courriels Sigle IMAP Port 143 (TCP) …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”