Summary
- RFC 5228, January 2008, defines "a language for filtering email messages at time of final delivery", meant to be "implementable on either a mail client or mail server".
- It is suited to servers "where users may not be allowed to execute arbitrary programs", because "the base language has no variables, loops, or ability to shell out to external programs".
- The reasoning is explicit: the language is "powerful enough to be useful but limited in order to allow for a safe server-side filtering system", and "the base language was not designed to be Turing-complete".
A program owned by someone who does not run it
Every mail filter is a small act of delegation: a user writes code, and someone else's machine runs it. In any ordinary language, that puts the user in charge of the server's resources. One accidental infinite loop, and everybody's inbox is down.
Sieve's answer is to remove the constructs that make running time unbounded. No loops, no recursion: the worst case is the length of the script, and the length of the script is a number the server can read before it runs a single line.
Subtraction as the safety mechanism
No variables means no state to reason about between commands. No functions means no recursion and no call depth. No shelling out means no dependency on whatever else the machine happens to have installed.
Each subtraction costs expressiveness and buys a property the administrator can actually rely on: every script terminates, every script runs in bounded memory, and a broken script cannot take the mail store down with it.
The require pact
Extensions must be declared with require before use. The specification says the keyword "protects scripts from having their behavior altered by extensions that the script author might not have even been aware of".
That is a forward-compatibility trick worth stealing: the script states its dependencies, an implementation that lacks one refuses to run the script at all, and silence cannot be mistaken for success. A missing feature becomes a loud failure rather than a quiet reinterpretation.
Limits are policy, minimums are protocol
The document lets a site cap how many actions a single message may trigger, but requires that at least one keep or fileinto be allowed. A script that does the minimum never fails on a stricter server.
That is how a standard divides labour with its operators: the floor is specified, the ceiling is local, and both fit in the same paragraph. The protocol guarantees the minimum; the site decides how much more it will tolerate.
What weakness buys
Because the language is small, a graphical interface can generate it, a validator can check it, and a client and a server can implement it identically. Predictability is the product; expressiveness was the price.
The bill arrives later. Users eventually want variables, and the extensions that added them spend pages re-establishing, by hand, the safety the base language got for free by having less.
The lesson about designing for limits
A language that runs on someone else's machine must carry a bound its owner can compute without trusting the author.
The general lesson is bigger than email: decide the worst case you can afford, write it into the syntax rather than into a policy document, and treat every later feature as a fresh argument about that bound. A timeout is a promise. A grammar is a proof.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






