ArticleslgStudy

science

Sieve (mail filtering language)

Sieve (mail filtering language) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sieve (mail filtering language) rather than just read about it. In short: Sieve is a programming language for email filtering. It owes its creation to the CMU Cyrus Project, creators of Cyrus IMAP server.

Key takeaways

  • Sieve (mail filtering language) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sieve (mail filtering language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sieve (mail filtering language) from memory before moving on to harder problems.

Reference excerpt

Sieve is a programming language for email filtering. 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 generalizes to other systems that meet these criteria. The current version of Sieve's base specification is outlined in RFC 5228, published in January 2008.

Language Sieve is a data-driven programming language, similar to earlier email filtering languages such as procmail and maildrop, and earlier line-oriented languages such as sed and AWK: it specifies conditions to match and actions to take on matching. This differs from general-purpose programming languages. While Sieve has many limitations – the base standard has no variables and no loops – it does allow conditional branching, preventing runaway programs. These limitations generally confine the language to simple filtering operations. Although extensions have been devised to extend the language to include variables and, limited 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. While Sieve was originally conceived as tool external to SMTP, RFC 5429 precognitively extends it in order to allow rejection at the SMTP protocol level.

Use The Sieve scripts may be generated by a GUI-based rules editor or they may be entered directly using a text editor. 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.

History The language was standardized in the (now-obsolete) RFC 3028 of January 2001, by Tim Showalter.

Extensions The IETF Sieve working group has updated the base specification in 2008 (RFC 5228), and has brought the following extensions to Proposed Standard status:

RFC 3894 – Copying without side effects; allows a script to be copied across mailboxes without halting the script. RFC 5173 – Body; allows a script to test the body of a message, not just its header. RFC 5183 – Environment; provides access to information about the Sieve interpreter and its system environment. RFC 5229 – Variables; allows the script to save and retrieve values in variables. RFC 5230 – Vacation; specifies an action to send a response informing the sender that the recipient may be away. RFC 5231 – 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. RFC 5232 – IMAP4flags; allows a script to test and set a message's IMAP flags. RFC 5233 – Subaddress; allows a script to test subaddresses of the form "user+detail@domain.example". RFC 5235 – Spamtest and Virustest; allows a script to interface with implementation RFC 5260 – Date and Index Extensions. RFC 5293 – Editheader; allows a script to add and delete message header fields. RFC 5429 – Reject; allows messages to be rejected at either the LMTP/SMTP level or with an MDN or DSN. RFC 5435 – Notifications; allows a script to trigger external notifications of email. RFC 5436 – Notifications; allows notifications to be sent via the mailto protocol RFC 5437 – XMPP notifications; specifies notifications via XMPP. RFC 5490 – Checking; Mailbox status and accessing mailbox metadata. RFC 5703 – MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure RFC 5804 – A Protocol for Remotely Managing Sieve Scripts RFC 6131 – Vacation; adds the ability to specify seconds in a vacation time period. RFC 6558 – MIME part conversion; allows a script to convert body parts between MIME types. RFC 6609 – Script inclusion; allow a user to include one script inside another. RFC 7352 - Detecting Duplicate Deliveries; allows a script to detect duplicate messages and define custom behavior in those cases.

Example This is an example sieve script:

See also Email filtering procmail maildrop fdm

References

External links Sieve.Info, a Wiki Site about Sieve Sieve Language Reference The old Sieve Home Page on web.archive.org RFC 5228 Sieve IETF Working Group Charter Sieve tutorial with many examples

Worked examples

Example 1 — a first encounter with Sieve (mail filtering language)

Start with the simplest possible case. Write down what Sieve (mail filtering language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sieve (mail filtering language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sieve (mail filtering language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sieve (mail filtering language)

In research
Sieve (mail filtering language) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sieve (mail filtering language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sieve (mail filtering language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Anti-spam, Email, Programming languages created in 2001, so understanding it makes those chapters shorter.
In everyday life
Look for Sieve (mail filtering language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sieve (mail filtering language)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sieve (mail filtering language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sieve (mail filtering language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sieve (mail filtering language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sieve (mail filtering language) in simple terms?

Sieve is a programming language for email filtering. It owes its creation to the CMU Cyrus Project, creators of Cyrus IMAP server.

Why does Sieve (mail filtering language) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sieve (mail filtering language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sieve (mail filtering language).

Tags

  • Anti-spam
  • Email
  • Programming languages created in 2001
  • Request for Comments

Keep exploring