File: sieve-filter.1.in

package info (click to toggle)
dovecot 1:2.2.13-12~deb8u4
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 38,792 kB
  • sloc: ansic: 341,472; sh: 16,920; makefile: 5,393; cpp: 1,474; perl: 265; xml: 44; python: 34; pascal: 27
file content (240 lines) | stat: -rw-r--r-- 10,792 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
.\" Copyright (c) 2010-2013 Pigeonhole authors, see the included COPYING file
.TH "SIEVE\-FILTER" 1 "2013-05-09" "Pigeonhole for Dovecot v2.2" "Pigeonhole"
.SH NAME
sieve\-filter \- Pigeonhole\(aqs Sieve mailbox filter tool

.PP
\fBWARNING: \fRThis tool is still experimental. Read this manual carefully, and
backup any important mail before using this tool. Also note that some of the
features documented here are not actually implemented yet; this is clearly
indicated where applicable.
.\"------------------------------------------------------------------------
.SH SYNOPSIS
.B sieve\-filter
.RI [ options ]
.I script\-file
.I source\-mailbox
.RI [ discard\-action ]
.SH DESCRIPTION
.PP
The \fBsieve\-filter\fP command is part of the Pigeonhole Project
(\fBpigeonhole\fR(7)), which adds Sieve (RFC 5228) support to the Dovecot
secure IMAP and POP3 server (\fBdovecot\fR(1)).
.PP
The Sieve language was originally meant for filtering messages upon delivery.
However, there are occasions when it is desirable to filter messages that are
already stored in a mailbox, for instance when a bug in a Sieve script caused
many messages to be delivered incorrectly. Using the sieve\-filter tool it is
possible to apply a Sieve script on all messages in a particular
\fIsource\-mailbox\fP, making it possible to delete messages, to store them in a
different mailbox, to change their content, and to change the assigned IMAP
flags and keywords. Attempts to send messages to the outside world are ignored
by default for obvious reasons, but, using the proper command line options, it
is possible to capture and handle outgoing mail as well.
.PP
If no options are specified, the sieve\-filter command runs in a simulation mode
in which it only prints what would be performed, without actually doing
anything. Use the \fB\-e\fP option to activate true script execution. Also, the
\fIsource\-mailbox\fP is opened read\-only by default, meaning that it normally
always remains unchanged. Use the \fB\-W\fP option to allow changes in the
\fIsource\-mailbox\fP.
.PP
Even with the \fB\-W\fP option enabled, messages in the \fIsource\-mailbox\fP
are only potentially modified or moved to a different folder. Messages are never
lost unless a \fIdiscard\-action\fP argument other than \fBkeep\fP (the default)
is specified. If the Sieve filter decides to store the message in the
\fIsource\-mailbox\fP, where it obviously already exists, it is never duplicated
there. In that case, the IMAP flags of the original message can be modified by
the Sieve interpreter using the \fIimap4flags\fP extension, provided that
\fB\-W\fP is specified. If the message itself is modified by the Sieve
interpreter (e.g. using the \fIeditheader\fP extension), a new message is stored
and the old one is expunged. However, if \fB-W\fP is omitted, the original
message is left untouched and the modifications are discarded.

.SS CAUTION
Although this is a very useful tool, it can also be very destructive when used
improperly. A small bug in your Sieve script in combination with the wrong
command line options could cause it to discard the wrong e\-mails. And, even if
the \fIsource\-mailbox\fP is opened in read\-only mode to prevent such mishaps,
it can still litter other mailboxes with spurious copies of your e\-mails if
your Sieve script decides to do so. Therefore, users are advised to read this
manual carefully and to use the simulation mode first to check what the script
will do. And, of course:
.PP
\fBMAKING A BACKUP IS IMPERATIVE FOR ANY IMPORTANT MAIL!\fP

.\"------------------------------------------------------------------------
.SH OPTIONS
.TP
.BI \-c\  config\-file
Alternative Dovecot configuration file path.
.TP
.B \-C
Force compilation. By default, the compiled binary is stored on disk. When this
binary is found during the next execution of \fBsieve\-filter\fP and its
modification time is more recent than the script file, it is used and the script
is not compiled again. This option forces the script to be compiled, thus
ignoring any present binary. Refer to \fBsievec\fP(1) for more information about
Sieve compilation.
.TP
.B \-D
Enable Sieve debugging.
.TP
.B \-e
Turns on execution mode. By default, the sieve\-filter command runs in
simulation mode in which it changes nothing, meaning that no mailbox is altered
in any way and no actions are performed. It only prints what would be done.
Using this option, the sieve\-filter command becomes active and performs the
requested actions.
.TP
.BI \-m\  default\-mailbox
The mailbox where the (implicit) \fBkeep\fP Sieve action stores messages. This
is equal to the \fIsource\-mailbox\fP by default. Specifying a different folder
will have the effect of moving (or copying if \fB\-W\fP is omitted) all kept
messages to the indicated folder, instead of just leaving them in the
\fIsource\-mailbox\fP. Refer to the explanation of the \fIsource\-mailbox\fP
argument for more information on mailbox naming.
.TP
.BI \-q\  output\-mailbox\  \fB[not\ implemented\ yet]\fP
Store outgoing e\-mail into the indicated \fIoutput\-mailbox\fP. By default,
the sieve\-filter command ignores Sieve actions such as redirect, reject,
vacation and notify, but using this option outgoing messages can be appended to
the indicated mailbox. This option has no effect in simulation mode. Flags of
redirected messages are not preserved.
.TP
.BI \-Q\  mail\-command\  \fB[not\ implemented\ yet]\fP
Send outgoing e\-mail (e.g. as produced by redirect, reject and vacation)
through the specified program. By default, the sieve\-filter command ignores
Sieve actions such as redirect, reject, vacation and notify, but using this
option outgoing messages can be fed to the \fBstdin\fP of an external shell
command. This option has no effect in simulation mode. Unless you really know
what you are doing, \fBDO NOT USE THIS TO FEED MAIL TO SENDMAIL!\fP.
.TP
.BI \-s\  script\-file\  \fB[not\ implemented\ yet]\fP
Specify additional scripts to be executed before the main script. Multiple
\fB\-s\fP arguments are allowed and the specified scripts are executed
sequentially in the order specified at the command line.
.TP
.BI \-u\  user
Run the Sieve script for the given \fIuser\fP.
.TP
.B \-v
Produce verbose output during filtering.
.TP
.B \-W
Enables write access to the \fIsource\-mailbox\fP. This allows (re)moving the
messages from the \fIsource\-mailbox\fP, changing their contents, and changing
the assigned IMAP flags and keywords.
.TP
.BI \-x\  extensions
Set the available extensions. The parameter is a space\-separated list of the
active extensions. By prepending the extension identifiers with \fB+\fP or
\fB\-\fP, extensions can be included or excluded relative to the configured set
of active extensions. If no extensions have a \fB+\fP or \fB\-\fP prefix, only
those extensions that are explicitly listed will be enabled. Unknown extensions
are ignored and a warning is produced.

For example \fB\-x\fP \(dq+imapflags \-enotify\(dq will enable the deprecated
imapflags extension and disable the enotify extension. The rest of the active
extensions depends on the \fIsieve_extensions\fP and
\fIsieve_global_extensions\fP settings. By default, i.e.
when \fIsieve_extensions\fP and \fIsieve_global_extensions\fP remain
unconfigured, all supported extensions are available, except for deprecated
extensions or those that are still under development.

.\"------------------------------------------------------------------------
.SH ARGUMENTS
.TP
.I script\-file
Specifies the Sieve script to (compile and) execute.

Note that this tool looks for a pre\-compiled binary file with a \fI.svbin\fP
extension and with basename and path identical to the specified script. Use the
\fB\-C\fP option to disable this behavior by forcing the script to be compiled
into a new binary.
.TP
.I source\-mailbox
Specifies the source mailbox containing the messages that the Sieve filter will
act upon.

This is the name of a mailbox, as visible to IMAP clients, except in UTF-8
format. The hierarchy separator between a parent and child mailbox is commonly
.RB \(aq / \(aq
or
.RB \(aq . \(aq,
but this depends on your selected mailbox storage format and
namespace configuration. The mailbox names may also require a namespace prefix.

This mailbox is not modified unless the \fB\-W\fP option is specified.
.TP
.I discard\-action
Specifies what is done with messages in the \fIsource\-mailbox\fP that where not
kept or otherwise stored by the Sieve script; i.e. those messages that would
normally be discarded if the Sieve script were executed at delivery.
The \fIdiscard\-action\fP parameter accepts one of the following values:
.RS 7
.TP
.BR keep\  (default)
Keep discarded messages in source mailbox.
.TP
.BI move\  mailbox
Move discarded messages to the indicated \fImailbox\fP. This is for instance
useful to move messages to a Trash mailbox. Refer to the explanation of
the \fIsource\-mailbox\fP argument for more information on mailbox naming.
.TP
.B delete
Flag discarded messages as \\DELETED.
.TP
.B expunge
Expunge discarded messages, meaning that these are removed irreversibly when the
tool finishes filtering.
.RE
.IP
When the \fB\-W\fP option is not specified, the \fIsource\-mailbox\fP is
immutable and the specified \fIdiscard\-action\fP has no effect. This means that
messages are at most \fIcopied\fP to a new location. In contrast, when the
\fB\-W\fP is specified, messages that are successfully stored somewhere else by
the Sieve script are \fBalways\fP expunged from the \fIsource\-mailbox\fP, with
the effect that these are thus \fImoved\fP to the new location. This happens
irrespective of the specified \fIdiscard\-action\fP. Remember: only discarded
messages are affected by the specified \fIdiscard\-action\fP.

.\"------------------------------------------------------------------------

.SH EXAMPLES

.TP
[...]

.\"------------------------------------------------------------------------
.SH "EXIT STATUS"
.B sieve\-filter
will exit with one of the following values:
.TP 4
.B 0
Sieve filter applied successfully. (EX_OK, EXIT_SUCCESS)
.TP
.B 1
Operation failed. This is returned for almost all failures.
(EXIT_FAILURE)
.TP
.B 64
Invalid parameter given. (EX_USAGE)
.\"------------------------------------------------------------------------
.SH FILES
.TP
.I @pkgsysconfdir@/dovecot.conf
Dovecot\(aqs main configuration file.
.TP
.I @pkgsysconfdir@/conf.d/90\-sieve.conf
Sieve interpreter settings (included from Dovecot\(aqs main configuration file)
.\"------------------------------------------------------------------------
@INCLUDE:reporting-bugs@
.\"------------------------------------------------------------------------
.SH "SEE ALSO"
.BR dovecot (1),
.BR dovecot\-lda (1),
.BR sieve\-dump (1),
.BR sieve\-test (1),
.BR sievec (1),
.BR pigeonhole (7)