SIEVE-TEST(1)
π hey bestie, this is the sieve-test page π
so like, you know how there's a whole manual section 1 for user commands? yeah β this is SIEVE-TEST(1), straight out of Dovecot, and it's genuinely one of the most useful little gremlins in the whole Pigeonhole family. let's get into it π
β¨ NAME β¨
sieve-test β Pigeonhole's Sieve script tester ποΈ
β¨ SYNOPSIS β¨
sieve-test [options] script-file mail-file
β¨ DESCRIPTION β¨
okay so first thing: the sieve-test command is part of Pigeonhole (pigeonhole(7)), which is the thing that adds Sieve (RFC 5228) and ManageSieve (RFC 5804) support to Dovecot (dovecot(1)). iconic lineage, no cap.
Using the sieve-test command, you can test how Sieve scripts actually execute. it evaluates the script for the message you hand it, and that gives you a set of Sieve actions. and here's the important bit: unless you pass the -e option, it does not actually execute those actions β meaning it does not store or forward the message anywhere at all. instead, it prints out a detailed list of what actions <em>would</em> normally take place. and even when -e <em>is</em> specified, no messages are ever transmitted to remote SMTP recipients, ever. the outgoing messages are always printed to stdout instead. periodt. π
this is a very useful tool to debug the execution of Sieve scripts, fr fr. you can use it to verify newly installed scripts for the intended behaviour, and it can hand you more detailed information about script execution problems that are reported by the Sieve plugin β for example by tracing the execution and evaluation of commands and tests respectively. it's giving detective energy πβ¨
β¨ OPTIONS β¨
-aorig-recipient-address β the original envelope recipient address. this is what Sieve'senvelopetest will compare to when the"to"envelope part is requested. some tests and actions will also use this as the script owner's e-mail address. if you omit this option, the recipient address gets retrieved from the"Envelope-To:", or"To:"message headers. and if none of those headers is present either, the recipient address defaults toβ¨recipient@example.comβ©. defaults, we love her.-cconfig-file β alternative Dovecot configuration file path. different config? sure babe, go off.-Cβ force compilation. by default, the compiled binary is stored on disk. when this binary is found during the next execution ofsieve-testand its modification time is more recent than the script file, it gets used and the script is <em>not</em> compiled again. this option forces the script to be compiled, thus ignoring any present binary. refer tosievec(1)for more information about Sieve compilation. basically: "no, bestie, recompile it, i don't trust the cache" π-Dβ enable Sieve debugging. theDstands for Detail in my heart. π-ddump-file β causes a dump of the generated code to be written to the specified file. this is identical to the dump produced bysieve-dump(1). using'-'as filename causes the dump to be written tostdout.-eβ enables true execution of the set of actions that results from running the script. use the-oparameter to specify themail_driver,mail_pathand other necessary storage settings. this allows actual delivery of messages to be tested. note that this will not transmit any messages to remote SMTP recipients β such actions only print the outgoing message tostdout. so like, it's real, but it's also not <em>that</em> real. π-fenvelope-sender β the envelope sender address (return path). this is what Sieve'senvelopetest will compare to when the"from"envelope part is requested. also, this is where response messages are 'sent' to. if this option is omitted, the sender address is retrieved from the"Return-Path:","Sender:"or"From:"message headers. if none of these headers is present either, the sender envelope address defaults toβ¨sender@example.comβ©.-mdefault-mailbox β the mailbox where thekeepaction stores the message. this is"INBOX"by default. classic.-osetting=value β overrides the configuration setting from/etc/dovecot/dovecot.confand from theuserdbwith the given value. in order to override multiple settings, the-ooption may be specified multiple times. stack 'em, queen π-rrecipient-address β the final envelope recipient address. some tests and actions will use this as the script owner's e-mail address. for example, this is what is used by thevacationaction to check whether a reply is appropriate. if the-roption is omitted, the original envelope recipient address will be used instead (see-aoption for more info).-sscript-file β specify additional scripts to be executed <em>before</em> the main script. multiple-sarguments are allowed and the specified scripts are executed sequentially in the order specified at the command line. order matters, bestie, don't play.-ttrace-file β enables runtime trace debugging. trace debugging provides detailed insight in the operations performed by the Sieve script. refer to the runtime trace debugging section below. the trace information is written to the specified file. using'-'as filename causes the trace data to be written tostdout.-Ttrace-option β configures runtime trace debugging, which is enabled with the-toption. refer to the runtime trace debugging section below.-uuser/mask β run the command only for the given user. it's also possible to use'*'and'?'wildcards (e.g.-u *@example.org). glob like the icon you are β¨-xauth_info β auth_info specifies additional conditions for the user command. the auth_info option string has to be given asname = valuepair. for multiple conditions the-xoption could be supplied multiple times.
possible names for the auth_info are:
serviceβ the service for which theuserdblookup should be tested. the value may be the name of a service, commonly used with Dovecot. for example:imap,pop3orsmtp.sessionβ session identifier.lipβ the local IP address (server) for the test.ripβ the remote IP address (client) for the test.lportβ the local port, e.g.143rportβ the remote port, e.g.24567real_lipβ the local IP to which the client connected on this host.real_ripβ the remote IP where client connected from to this host.real_lportβ the local port to which client connected to to this host.real_rportβ the remote port from where the client connected from to this host.forward_<field>β field to forward as%{forward:field}to auth process.
β¨ ARGUMENTS β¨
- script-file β specifies the script to (compile and) execute.
note that this tool looks for a pre-compiled binary file with a .svbin extension and with basename and path identical to the specified script. use the -C option to disable this behavior by forcing the script to be compiled into a new binary.
- mail-file β specifies the file containing the e-mail message to test with. yes bestie, you need a message. bring a friend. π
β¨ USAGE β¨
π RUNTIME TRACE DEBUGGING
using the -t option, the sieve-test tool can be configured to print detailed trace information on the Sieve script execution to a file or standard output. for example, the encountered commands, the performed tests and the matched values can be printed. it's basically a little reality show for your script π¬
the runtime trace can be configured using the -T option, which can be specified multiple times. it can be used as follows:
-T level=...β set the detail level of the trace debugging. one of the following values can be supplied:actions(default) : only print executed action commands, likekeep,fileinto,rejectandredirect.commands: print any executed command, excluding test commands.tests: print all executed commands and performed tests.matching: print all executed commands, performed tests and the values matched in those tests.
-T debugβ print debug messages as well. this is usually only useful for developers and is likely to produce messy output. messy output warning, we been knew π-T addressesβ print byte code addresses for the current trace output. normally, only the current Sieve source code position (line number) is printed. the byte code addresses are equal to those listed in a binary dump produced using the-doption or by thesieve-dump(1)command.
π DEBUG SIEVE EXTENSION
to improve script debugging, this Sieve implementation supports a custom Sieve language extension called 'vnd.dovecot.debug'. it adds the debug_log command that allows logging debug messages.
example:
require "vnd.dovecot.debug";
if header :contains "subject" "hello" {
debug_log "Subject header contains hello!";
}
tools such as sieve-test, sievec(1) and sieve-dump(1) have support for the vnd.dovecot.debug extension enabled by default and it is not necessary to enable nor possible to disable the availability of the debug extension with the -x option. the logged messages are written to stdout in this case.
in contrast, for the actual Sieve plugin for the Dovecot LDA (dovecot-lda(1)) the vnd.dovecot.debug extension needs to be enabled explicitly using the sieve_extensions setting or sieve_global_extensions setting setting. the messages are then logged to the user's private script log file. if used in a global script, the messages are logged through the default Dovecot logging facility.
β¨ EXIT STATUS β¨
sieve-test will exit with one of the following values:
0β execution was successful. (EX_OK,EXIT_SUCCESS) π1β operation failed. this is returned for almost all failures. (EXIT_FAILURE) π64β invalid parameter given. (EX_USAGE) π
β¨ FILES β¨
/etc/dovecot/dovecot.confβ Dovecot's main configuration file./etc/dovecot/conf.d/90-sieve.confβ Sieve interpreter settings (included from Dovecot's main configuration file)
β¨ REPORTING BUGS β¨
report bugs, including doveconf -n output, to the Dovecot Mailing List β¨dovecot@dovecot.orgβ©. information about reporting bugs is available at: β¨https://dovecot.org/bugreport.htmlβ©
bestie do NOT forget the doveconf -n output, they will simply ask you for it and then you have to send two emails and that's embarrassing for everyone π«Ά
β¨ SEE ALSO β¨
dovecot(1), dovecot-lda(1), sieve-dump(1), sieve-filter(1), sievec(1), pigeonhole(7)
and that's the whole page, babes π this version was built from f00471c, dated August 2026 β go forth and debug your Sieve scripts, you absolute main character ππ¦
π¦ where this page comes from
- alpine 3.23: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- alpine 3.24: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- arch rolling: pigeonhole 2.4.5-1 Β· LGPL-2.1-only
- fedora 43: dovecot-pigeonhole 1:2.4.5-1.fc43 Β· MIT AND LGPL-2.1-only
- fedora 44: dovecot-pigeonhole 1:2.4.5-1.fc44 Β· MIT AND LGPL-2.1-only
- nixos 26.05: dovecot-pigeonhole 2.4.5
- nixpkgs unstable: dovecot-pigeonhole 2.4.5
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms