1 \input texinfo @c -*-texinfo-*-
4 @settitle Emacs Sieve Manual
10 * Sieve: (sieve). Managing Sieve scripts in Emacs.
15 @setchapternewpage odd
19 This file documents the Emacs Sieve package.
21 Copyright (C) 2001 Free Software Foundation, Inc.
23 Permission is granted to copy, distribute and/or modify this document
24 under the terms of the GNU Free Documentation License, Version 1.1 or
25 any later version published by the Free Software Foundation; with no
26 Invariant Sections, with the Front-Cover texts being ``A GNU
27 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
28 license is included in the section entitled ``GNU Free Documentation
29 License'' in the Emacs manual.
31 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
32 this GNU Manual, like GNU software. Copies published by the Free
33 Software Foundation raise funds for GNU development.''
35 This document is part of a collection distributed under the GNU Free
36 Documentation License. If you want to distribute this document
37 separately from the collection, you can do so by adding a copy of the
38 license to the document, as described in section 6 of the license.
44 @title Emacs Sieve Manual
46 @author by Simon Josefsson
49 @vskip 0pt plus 1filll
50 Copyright @copyright{} 2001 Free Software Foundation, Inc.
52 Permission is granted to copy, distribute and/or modify this document
53 under the terms of the GNU Free Documentation License, Version 1.1 or
54 any later version published by the Free Software Foundation; with the
55 Invariant Sections being none, with the Front-Cover texts being ``A GNU
56 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
57 license is included in the section entitled ``GNU Free Documentation
58 License'' in the Emacs manual.
60 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
61 this GNU Manual, like GNU software. Copies published by the Free
62 Software Foundation raise funds for GNU development.''
64 This document is part of a collection distributed under the GNU Free
65 Documentation License. If you want to distribute this document
66 separately from the collection, you can do so by adding a copy of the
67 license to the document, as described in section 6 of the license.
74 @top Sieve Support for Emacs
76 This manual documents the Emacs Sieve package.
78 It is intended as a users manual for Sieve Mode and Manage Sieve, and
79 as a reference manual for the @samp{sieve-manage} protocol Emacs Lisp
82 Sieve is a language for server-side filtering of mail. The language
83 is documented in RFC 3028. This manual does not attempt to document
84 the language, so keep RFC 3028 around.
87 * Installation:: Getting ready to use the package.
88 * Sieve Mode:: Editing Sieve scripts.
89 * Managing Sieve:: Managing Sieve scripts on a remote server.
90 * Manage Sieve API :: Interfacing to the Manage Sieve Protocol API.
91 * Standards:: A summary of RFCs and working documents used.
92 * Index:: Function and variable index.
101 The Sieve package should come with your Emacs version, and should be
102 ready for use directly.
104 However, to manually set up the package you can put the following
105 commands in your @code{~/.emacs}:
108 (autoload 'sieve-mode "sieve-mode")
111 (setq auto-mode-alist (cons '("\\.si\\(v\\|eve\\)\\'" . sieve-mode)
119 Sieve mode provides syntax-based indentation, font-locking support and
120 other handy functions to make editing Sieve scripts easier.
122 Use @samp{M-x sieve-mode} to switch to this major mode. This command
123 runs the hook @code{sieve-mode-hook}.
125 @vindex sieve-mode-map
126 @vindex sieve-mode-syntax-table
127 Sieve mode is derived from @code{c-mode}, and is very similar except
128 for the syntax of comments. The keymap (@code{sieve-mode-map}) is
129 inherited from @code{c-mode}, as are the the variables for customizing
130 indentation. Sieve mode has its own abbrev table
131 (@code{sieve-mode-abbrev-table}) and syntax table
132 (@code{sieve-mode-syntax-table}).
134 In addition to the editing utility functions, Sieve mode also contains
135 bindings to manage Sieve scripts remotely. @pxref{Managing Sieve}.
142 @cindex manage remote sieve script
143 Open a connection to a remote server using the Managesieve protocol.
148 @cindex upload sieve script
149 Upload the Sieve script to the currently open server.
155 @chapter Managing Sieve
157 Manage Sieve is a special mode used to display Sieve scripts available
158 on a remote server. It can be invoked with @kbd{M-x sieve-manage
159 RET}, which queries the user for a server and if necessary, user
162 When a server has been succesfully contacted, the Manage Sieve buffer
163 looks something like:
166 Server : mailserver:2000
168 2 scripts on server, press RET on a script name edits it, or
169 press RET on <new script> to create a new script.
175 One of the scripts are highlighted, and standard point navigation
176 commands (@kbd{<up>}, @kbd{<down>} etc) can be used to navigate the
179 The following commands are available in the Manage Sieve buffer:
185 @findex sieve-activate
186 Activates the currently highlighted script.
190 @findex sieve-deactivate
191 Deactivates the currently highlighted script.
195 @findex sieve-deactivate-all
196 Deactivates all scripts.
201 Remove currently highlighted script.
209 @findex sieve-edit-script
210 Bury the server buffer and download the currently highlighted script
211 into a new buffer for editing in Sieve mode (@pxref{Sieve Mode}).
215 @findex sieve-edit-script-other-window
216 Create a new buffer in another window containing the currently
217 highlighted script for editing in Sieve mode (@pxref{Sieve Mode}).
221 @findex sieve-bury-buffer
222 Bury the Manage Sieve buffer without closing the connection.
229 Displays help in the minibuffer.
233 @node Manage Sieve API
234 @chapter Manage Sieve API
236 The @file{sieve-manage.el} library contains low-level functionality
237 for talking to a server with the @sc{managesieve} protocol.
239 A number of user-visible variables exist, which all can be customized
240 in the @code{sieve} group (@kbd{M-x customize-group RET sieve RET}):
244 @item sieve-manage-default-user
245 @vindex sieve-manage-default-user
246 Sets the default username.
248 @item sieve-manage-default-port
249 @vindex sieve-manage-default-port
250 Sets the default port to use, the suggested port number is @code{2000}.
252 @item sieve-manage-log
253 @vindex sieve-manage-log
254 If non-nil, should be a string naming a buffer where a protocol trace
255 is dumped (for debugging purposes).
259 The API functions include:
263 @item sieve-manage-open
264 @findex sieve-manage-open
265 Open connection to managesieve server, returning a buffer to be used
266 by all other API functions.
268 @item sieve-manage-opened
269 @findex sieve-manage-opened
270 Check if a server is open or not.
272 @item sieve-manage-close
273 @findex sieve-manage-close
274 Close a server connection.
276 @item sieve-manage-authenticate
277 @findex sieve-manage-authenticate
278 Authenticate to the server.
280 @item sieve-manage-capability
281 @findex sieve-manage-capability
282 Return a list of capabilities the server support.
284 @item sieve-manage-listscripts
285 @findex sieve-manage-listscripts
286 List scripts on the server.
288 @item sieve-manage-havespace
289 @findex sieve-manage-havespace
290 Returns non-nil iff server have roam for a script of given size.
292 @item sieve-manage-getscript
293 @findex sieve-manage-getscript
294 Download script from server.
296 @item sieve-manage-putscript
297 @findex sieve-manage-putscript
298 Upload script to server.
300 @item sieve-manage-setactive
301 @findex sieve-manage-setactive
302 Indicate which script on the server should be active.
309 The Emacs Sieve package implements all or parts of a small but
310 hopefully growing number of RFCs and drafts documents. This chapter
311 lists the relevant ones. They can all be fetched from
312 @samp{http://quimby.gnus.org/notes/}.
317 Sieve: A Mail Filtering Language.
319 @item draft-martin-managesieve-03
320 A Protocol for Remotely Managing Sieve Scripts