Skip to content
nofeb

What is Sieve?

Also called the Sieve mail filtering language

Sieve is a standard language for filtering email on the server, defined in RFC 5228. A Sieve script is a list of tests over headers, addresses, the envelope and size, each with actions such as fileinto, redirect, reject, discard or keep. Because it runs on the server, a filter applies before any person, client or agent reads the message.

Checked against the engine on .

Shipped nofeb's support for Sieve

How does Sieve work?

The base language is small on purpose: no loops, no network access, nothing that can run away. Extensions add what most filters need and are declared with require: fileinto to move mail, imap4flags to set flags, envelope to test the SMTP envelope, body to test the text, vacation for auto-replies, copy to keep a copy when redirecting, and reject to refuse a message with a reason.

Its portability is the point. Many mail servers and hosted mailboxes run Sieve, so a script can move with a mailbox from one provider to another, and an administrator can read a filter without learning a vendor's rule format.

Its limits matter as much: Sieve tests the message, not what you know about it. It cannot see a CRM field, a model's judgement about the message or the result of a malware scan unless the server exposes them, which is why servers that know more usually keep a richer rule format beside it.

A Sieve script nofeb imports
require ["fileinto", "imap4flags", "envelope"];
# rule: carrier quotes
if address :domain :is "from" "carrier.example" {
  addflag ["\\Flagged", "quotes"];
  fileinto "Archive";
  stop;
}

How does nofeb use Sieve?

  • nofeb's rules are a JSON format that tests sender, recipients, subject, body, headers, attachments, size, the receiving server's security verdict, metadata and decisions, with actions that label, move, flag, set metadata, quarantine, forward, auto-reply or reject. Sieve is how they come in and go out.
  • Import (POST /v1/rules/sieve) accepts RFC 5228 core plus fileinto, imap4flags, envelope, reject, vacation (days and subject), copy and body. Every unsupported construct is reported with its line and column, and nothing is imported unless the whole script maps; dry_run shows the rules it would create.
  • Mappings are exact: fileinto moves to Inbox, Archive, Junk or Trash; \Seen marks read, \Flagged flags, and any other flag becomes a label; redirect :copy forwards and keeps the original. A # rule: name comment names the next rule, and export writes one before every rule, so a script round-trips with its names.
  • Export (GET /v1/rules/sieve) writes enabled rules in evaluation order and lists those Sieve cannot express, such as metadata, decisions, security-verdict tests or quarantine, in skipped with the reason; strict=true refuses instead.

Frequently asked questions

Can I bring my existing Sieve filters to an agent's inbox?

Yes, if they use the supported extensions. Import the script with a dry run first; anything that does not map is listed with its position, so you can rewrite those lines before importing for real.

Do forwards and auto-replies from rules bypass the sending policy?

No. They are sent through the same path as any other send, at most once per message, and never for automated mail or mail another rule generated.

Status of everything on this page

Every capability named above, with its status as reconciled against the engine.

CapabilityWhat it doesStatus
Rules and Sieve Declarative rules over sender, recipients, subject, body, headers, attachments, size, the security verdict, metadata and decisions, that label, move, flag, set metadata, quarantine, forward, auto-reply or reject. Test rules against a stored message with a per-rule trace, and import or export Sieve, with anything that cannot be mapped reported line by line. Shipped
Recipient and sender allowlists and blocklists Lists of addresses, domains or wildcards per organization, pod or inbox: who an agent may write to, and whose mail it reads. A blocked recipient is refused on every autonomy tier, a blocked sender's mail is rejected or quarantined, and you choose whether a send outside the allowlist is held for approval or refused. A check call predicts what a send or an inbound message would meet before it happens. Shipped
Decisions on every message A default set of typed decisions on every inbound email (intent, urgency, needs-reply, automated, verification email, phishing, injection risk, requires-human and language) with a probability each, your own decision schemas beside them, human relabels that correct and retrain it, per-question accuracy and calibration stats, and confidence-gated sending for the send_when_confident tier. Decisions run without leaving nofeb by default; a third-party model sees mail only if you opt in. Shipped