Skip to content
Module 6 · Lesson 13 of 25

Global vs per-user Sieve scripts

Part of Dovecot: IMAP/POP3 at Production Scale, in the Sieve Filtering & Server-Side Rules module.

Author

Global scripts run for every user. Per-user scripts are uploaded via ManageSieve.

conf.d/90-sieve.conf:

plugin {
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_before = /etc/dovecot/sieve/before.sieve
  sieve_after  = /etc/dovecot/sieve/after.sieve
  sieve_dir = ~/sieve
  sieve_extensions = +editheader +mailbox +spamtest
}

Execution order: sieve_before → user script → sieve_after.

Common global rules in before.sieve:

require ["fileinto", "spamtest", "spamtestplus"];

if spamtest :percent :value "ge" "75" {
  fileinto :create "Junk";
  stop;
}

Compile after editing:

sievec /etc/dovecot/sieve/before.sieve

🎯 Always test new global rules with one mailbox first. A broken before.sieve breaks delivery for everyone.

Sign in to keep track of what you have read.

Pulse · email sending

Sending infrastructure that is yours alone.

Every domain gets its own MX host, IP, DKIM selector and certificate. Take it managed, and we run it for you, or buy a licence and run it on your own servers.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat: monitoring that tells you the fixConsulting: $65/hr, no retainer