Skip to content
Module 6 · Lesson 12 of 25

Sieve basics and Dovecot extensions

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

Author

Sieve (RFC 5228) is a small declarative language for mail filtering. Dovecot's Pigeonhole interpreter supports the full standard plus useful extensions.

Example: file by sender + tag urgent:

require ["fileinto", "imap4flags"];

if header :contains "from" "alerts@stripe.com" {
  fileinto "INBOX/Finance";
  setflag "\\Flagged";
  stop;
}

if header :contains "subject" "[URGENT]" {
  setflag "\\Flagged";
}

if address :is "to" "newsletter@example.com" {
  fileinto "INBOX/Newsletters";
}

Useful Dovecot Sieve extensions:

Extension Purpose
fileinto Move to specific folder
imap4flags Set/unset flags
vacation Auto-responder
mailbox Auto-create destination folders
spamtest / spamtestplus Read Rspamd score
editheader Add/remove headers
extprograms Pipe to external scripts

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