Files
bongo/docs/sieve.md
T
2026-07-22 17:58:11 +02:00

2.6 KiB

Sieve filtering and ManageSieve

Bongo stores each user's server-side mail rules independently from the mail payloads. bongosieve provides the ManageSieve management protocol, while bongorules evaluates the active script as mail passes through the Queue. Thunderbird and other ManageSieve clients can therefore maintain filters without editing server files.

Listener and authentication

ManageSieve is disabled by the base template until it is required. Its suffixless sieve document has conservative loopback defaults:

{
  "enabled": false,
  "listen_address": "127.0.0.1",
  "port": 4190,
  "allow_legacy_tls": false,
  "proxy_protocol_enabled": false,
  "proxy_protocol_networks": [],
  "maximum_script_size": 1048576,
  "maximum_connections": 64
}

The greeting offers STARTTLS; GNU GSASL mechanisms are advertised only after TLS. Authentication uses the same Bongo user and app-password policy as the mail protocols, with the Sieve service scope. Cleartext received after a STARTTLS command is discarded before negotiation. PROXY protocol has the same source-restricted rules as the other mail listeners.

Management protocol

The RFC 5804 service implements CAPABILITY, STARTTLS, AUTHENTICATE, HAVESPACE, PUTSCRIPT, CHECKSCRIPT, LISTSCRIPTS, GETSCRIPT, SETACTIVE, RENAMESCRIPT, DELETESCRIPT, NOOP, and LOGOUT. Script names and literals are bounded, syntax is validated before activation, an active script cannot be deleted accidentally, and scripts are isolated by authenticated user.

The implementation advertises fileinto, envelope, body, variables, vacation, and vacation-seconds. Actions include keep, discard, file into a folder, redirect, reject, and vacation response. Vacation history is durable so repeated delivery does not generate an immediate reply loop. Scripts and vacation state live in /var/lib/bongo/dbf/sieve.sqlite; include that database and its SQLite sidecars in backups.

Filters in Webmail

The Web filter editor and ManageSieve are two interfaces to the same intended user rule model. A filter may match senders or other message properties and deliver matching messages to a folder such as Family. Mailing-list recognition is one possible filter condition, not a separate replacement for the filter system. Future JMAP support must map to the same rules rather than creating a third incompatible store.

Test script upload, syntax rejection, activation, rename, retrieval, deletion, folder delivery, redirect, reject, vacation deduplication, and quota limits before exposing the service. The 0.7 release cases are SIEVE-01 through SIEVE-05 in release-testing-0.7.md.