1
.TH "SIEVE-TEST" "1" "4 July 2009"
3
sieve-test \- Sieve script tester for the Dovecot secure IMAP server
7
[\fB-d\fR \fIdump-file\fR]
9
[\fB-f\fR \fIenvelope-sender\fR]
10
[\fB-l\fR \fImail-location\fR]
11
[\fB-m\fR \fIdefault-mailbox\fR]
12
[\fB-r\fR \fIrecipient-address\fR]
13
[\fB-s\fR \fIscript-file\fR]
15
[\fB-x\fR "\fIextension extension ...\fR"]
16
\fIscript-file\fR \fImail-file\fR
19
The \fBsieve-test\fP command is part of the Sieve implementation for the Dovecot secure
20
IMAP server. Sieve (RFC 5228) is a simple and highly extensible language for filtering
21
e-mail messages. It can be implemented for any type of mail access protocol, mail
22
architecture and operating system. The language cannot execute external programs and in
23
its basic form it does not provide the means to cause infinite loops, making it suitable
24
for running securely on mail servers where mail users have no permission run arbitrary programs.
26
Using the \fBsieve-test\fP command, the execution of Sieve scripts can be tested. This evaluates
27
the script for the provided message, yielding a set of Sieve actions. Unless the \fB-e\fP option is
28
specified, it does not actually execute these actions, meaning that it does not store or forward the
29
message anywere. In stead, it prints a detailed list of what actions would normally take place.
30
Note that, even when \fB-e\fP is specified, no messages are ever transmitted to remote SMTP
31
recipients. The outgoing messages are printed to \fBstdout\fP in stead.
33
This is a very useful tool to debug the execution of Sieve scripts. It can be used to verify
34
newly installed scripts for the intended behaviour and it can provide more detailed information
35
about script execution problems that are reported by the Sieve plugin.
37
The command has two mandatory arguments: the \fIscript-file\fP argument, which specifies the
38
script to (compile and) execute, and the \fImail-file\fP argument, which specifies the file
39
containing the e-mail message to filter.
41
Note that this tool looks for a pre-compiled binary file with a \fI.svbin\fP extension and
42
with basename and path identical to the specified script. Use the \fB-c\fP option to disable this
43
behavior by forcing the script to be compiled into a new binary.
47
Force compilation. By default, the compiled binary is stored on disk. When this binary is found
48
during the next execution of \fBsieve-test\fP and its modification time is more recent than the
49
script file, it is used and the script is not compiled again. This option forces the script to be
50
compiled, thus ignoring any present binary. Refer to \fBsievec\fP(1) for more information about
53
\fB-d\fP \fIdump-file\fP
54
Causes a dump of the generated code to be written to the specified file. This is identical to the
55
dump produced by \fBsieved\fR(1). Using '-' as filename causes the dump to be written to \fBstdout\fP.
58
Turns on true execution of the set of actions that results from running the script. In combination
59
with the \fB-l\fP parameter, the actual delivery of messages can be tested. Note that this will
60
not transmit any messages to remote SMTP recipients. Such actions only print the outgoing message
63
\fB-f\fP \fIenvelope-sender\fP
64
The envelope sender or return path. This is what Sieve's envelope test will compare to when the
65
"from" envelope part is requested. Also, this is where response messages are sent to.
67
\fB-l\fP \fImail-location\fP
68
The location of the user's mail store. The syntax of this option's \fImail-location\fP parameter
69
is identical to what is used for the mail_location setting in the Dovecot config file. This
70
parameter is typically used in combination with \fB-e\fP to test the actual delivery of messages.
71
If \fB-l\fP is omitted when \fB-e\fP is specified, mail store actions like fileinto and keep are
74
\fB-m\fP \fIdefault-mailbox\fP
75
The mailbox where the keep action stores the message. This is "INBOX" by default.
77
\fB-r\fP \fIrecipient-address\fP
78
The envelope recipient address. This is what Sieve's envelope test will compare to when the "to"
79
envelope part is requested. Some tests and actions will also use this as the owner's e-mail address.
81
\fB-s\fP \fIscript-file\fP
82
Specify additional scripts to be executed before the main script. Multiple \fB-s\fP arguments are
83
allowed and the specified scripts are executed sequentially in the order specified at the command
87
Enable simple trace debugging; prints all encountered byte code instructions to \fBstdout\fP. This is
88
currently only intelligible for developers.
90
\fB-x\fP "\fIextension extension ...\fP"
91
Set the available extensions. The parameter is a space-separated list of the active extensions. By
92
prepending the extension identifiers with \fB+\fP or \fB-\fP, extensions can be included or excluded
93
relative to the default set of extensions. If no extensions have a \fB+\fP or \fB-\fP prefix, only
94
those extensions that are explicitly listed will be enabled. Unknown extensions are ignored and a
95
warning is produced. By default, all supported extensions are available, except for deprecated extensions
96
or those that are still under development.
98
For example \fB-x\fP "+imapflags -enotify" will enable the deprecated imapflags extension along with all
99
extensions that are available by default, except for the enotify extension.
102
To improve script debugging, the Sieve command line tools such as \fBsieve-test\fP support a custom
103
Sieve language extension called 'vnd.dovecot.debug'. It adds the \fBdebug_print\fP command that allows
104
printing debug messages to \fBstdout\fP.
108
require "vnd.dovecot.debug";
110
if header :contains "subject" "hello" {
112
debug_print "Subject header contains hello!";
116
Other tools like \fBsievec\fP and \fBsieved\fP also recognize the vnd.dovecot.debug extension. In contrast,
117
the actual Sieve plugin for the Dovecot LDA does not allow the use of the debug extension. So, keep in mind that
118
scripts and compiled binaries that refer to de debug extension will fail to be run by the Sieve plugin itself.
120
Note that it is not necessary to enable nor possible to disable the availability of the debug extension with
124
The Sieve implementation for Dovecot was written by Stephan Bosch <stephan@rename-it.nl>.
126
Dovecot was written by Timo Sirainen <tss@iki.fi>.