check-sieve(1)

πŸ“¦ version 1.0.1, in arch rolling

πŸ’… check-sieve(1) β€” General Commands Manual, but make it group chat πŸ’…

okay so bestie, this is the manual for check-sieve: the syntax checker for mail sieves. it lives in the General Commands Manual, it has a whole lot of RFC energy, and we're gonna get into all of it. no cap. 🫢

🌸 NAME 🌸

check-sieve β€” syntax checker for mail sieves. periodt. πŸ’–

✨ SYNOPSIS ✨

here's the shape of it, bestie:

check-sieve [options] file [ file ...  ]
check-sieve --help
check-sieve --version

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so check-sieve is a simple syntax checker for server-side mail sieves. it supports many mail-sieve RFCs, and the details are literally below. iykyk. 🌈

πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” show the program help.
  • --max-list-length N β€” check the length of string lists, and flag any that are longer than the specified length.
  • --server <host>:<port> β€” connect to the specified server, and only enable advertised capabilities.
  • --trace-parser β€” trace the operation of the parser.
  • --trace-scanner β€” trace the operation of the scanner.
  • --trace-tree β€” trace the abstract-syntax-tree.
  • --simulate <email-file> β€” simulate sieve processing against an email file (.eml format). see SIMULATION below.
  • --test-dir <dir> β€” run simulation for every .eml file in dir and diff each result against a matching .out file. see SIMULATION below.
  • --rebase <dir> β€” regenerate the .out files in dir from current simulation output. see SIMULATION below.
  • --version β€” print out version information.

πŸ§ͺ SIMULATION πŸ§ͺ

check-sieve can simulate how a sieve script sorts mail, making it straightforward to verify script behavior without deploying to a mail server. so you can test the vibe before it hits prod. πŸ’…

πŸ’Œ Single-message simulation πŸ’Œ

  • --simulate <email-file> β€” validates the sieve script and then evaluates it against the given .eml file. each test that matches is printed as MATCH: <test> and each executed action as ACTION: <action>. if no delivery action is taken, keep (implicit) is added automatically per RFC 5228 Β§4.2.
NOTE: Many RFC extensions are still in progress. Filing an issue for unsupported extensions will help prioritize what to work on next. 🫢

🧺 Batch testing with a test directory 🧺

A test directory contains .eml files and, optionally, .out files that record expected simulation output. the .out file for a given email is named after the email's stem (e.g. msg.eml β†’ msg.out).

  • --test-dir <dir> β€” runs simulation against every .eml file in dir. for each email that has a matching .out file, the actual output (with the environment-specific first line stripped) is diffed against it. if all comparisons pass the program exits 0 with no output. if any differ, each diff is printed followed by a summary on stderr and the program exits 1. emails without a .out file are simulated but not compared.
  • --rebase <dir> β€” regenerates the .out file for every .eml file in dir, creating or overwriting as needed. run this after making intentional changes to a sieve script or the simulator to update the expected output before re-running --test-dir.

πŸ› BUGS πŸ›

for information on existing issues, and to file a bug report check the following URL: https://github.com/dburkart/check-sieve/issues

πŸ‘‘ AUTHORS πŸ‘‘

  • Dana Burkart
  • Stuart Montgomery

🌈 SUPPORTED RFCs 🌈

the full list of supported RFCs is:

  • Sieve: An Email Filtering Language (RFC 5228)
  • Variables Extension (RFC 5229)
  • Date and Index Extensions (RFC 5260)
  • Vacation Extension (RFC 5230)
  • Vacation "Seconds" Parameter (RFC 6131)
  • Include Extension (RFC 6609)
  • Copying Without Side Effects (RFC 3894)
  • Reject and Extended Reject Extensions (RFC 5429)
  • Body Extension (RFC 5173)
  • Relational Extension (RFC 5231)
  • MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure (RFC 5703)
  • Imap4flags Extension (RFC 5232)
  • Editheader Extension (RFC 5293)
  • Regex Extension (DRAFT)
  • Spamtest and Virustest Extensions (RFC 5235)
  • Extensions for Notifications (RFC 5435)
  • Subaddress Extension (RFC 5233)
  • Ihave Extension (RFC 5463)
  • Environment Extension (RFC 5183)
  • Sieve Notification Mechanism: mailto (RFC 5436)
  • Internet Message Access Protocol (IMAP) Events (RFC 6785)
  • Converting Messages before Delivery (RFC 6558)
  • Detecting Duplicate Deliveries (RFC 7352)
  • Externally Stored Lists (RFC 6134)
  • Delivering to Special-Use Mailboxes (RFC 8579)
  • File Carbon Copy (FCC) (RFC 8580)
  • Delivery by MAILBOXID (RFC 9042)
  • Delivery Status Notifications and Deliver-By Extensions (RFC 6009)
  • Extension for Processing Calendar Attachments (RFC 9671)
  • Proton Expiration Extension (vendor-specific)
  • Proton Eval Extension (vendor-specific)
  • Dovecot Invoking External Programs (vendor-specific)

mwah πŸ’‹ β€” this page is from version 1.0.1, dated 10 Apr 2026, and it's the check-sieve(1) page. byeee bestie 🫢

πŸ“¦ where this page comes from