2001-11-01 Simon Josefsson <jas@extundo.com>
[gnus] / texi / sieve.texi
1 \input texinfo                  @c -*-texinfo-*-
2
3 @setfilename sieve
4 @settitle Emacs Sieve Manual
5 @synindex fn cp
6 @synindex vr cp
7 @synindex pg cp
8 @dircategory Emacs
9 @direntry
10 * Sieve: (sieve).               Managing Sieve scripts in Emacs.
11 @end direntry
12 @iftex
13 @finalout
14 @end iftex
15 @setchapternewpage odd
16
17 @ifnottex
18
19 This file documents the Emacs Sieve package.
20
21 Copyright (C) 2001 Free Software Foundation, Inc.
22
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.
30
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.''
34
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.
39 @end ifnottex
40
41 @tex
42
43 @titlepage
44 @title Emacs Sieve Manual
45
46 @author by Simon Josefsson
47 @page
48
49 @vskip 0pt plus 1filll
50 Copyright @copyright{} 2001 Free Software Foundation, Inc.
51
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.
59
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.''
63
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.
68 @end titlepage
69 @page
70
71 @end tex
72
73 @node Top
74 @top Sieve Support for Emacs
75
76 This manual documents the Emacs Sieve package.
77
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
80 API.
81
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.
85
86 @menu
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.
93 @end menu
94
95
96 @node Installation
97 @chapter Installation
98 @cindex Install
99 @cindex Setup
100
101 The Sieve package should come with your Emacs version, and should be
102 ready for use directly.
103
104 However, to manually set up the package you can put the following
105 commands in your @code{~/.emacs}:
106
107 @lisp
108 (autoload 'sieve-mode "sieve-mode")
109 @end lisp
110 @lisp
111 (setq auto-mode-alist (cons '("\\.si\\(v\\|eve\\)\\'" . sieve-mode)
112                             auto-mode-alist))
113 @end lisp
114
115
116 @node Sieve Mode
117 @chapter Sieve Mode
118
119 Sieve mode provides syntax-based indentation, font-locking support and
120 other handy functions to make editing Sieve scripts easier.
121
122 Use @samp{M-x sieve-mode} to switch to this major mode.  This command
123 runs the hook @code{sieve-mode-hook}.
124
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}).
133
134 In addition to the editing utility functions, Sieve mode also contains
135 bindings to manage Sieve scripts remotely. @pxref{Managing Sieve}.
136
137 @table @kbd
138
139 @item C-c RET
140 @kindex C-c RET
141 @findex sieve-manage
142 @cindex manage remote sieve script
143 Open a connection to a remote server using the Managesieve protocol.
144
145 @item C-c C-l
146 @kindex C-c C-l
147 @findex sieve-upload
148 @cindex upload sieve script
149 Upload the Sieve script to the currently open server.
150
151 @end table
152
153
154 @node Managing Sieve
155 @chapter Managing Sieve
156
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
160 credentials to use.
161
162 When a server has been succesfully contacted, the Manage Sieve buffer
163 looks something like:
164
165 @example
166 Server  : mailserver:2000
167
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.
170         <new script>
171  ACTIVE .sieve
172         template.siv
173 @end example
174
175 One of the scripts are highlighted, and standard point navigation
176 commands (@kbd{<up>}, @kbd{<down>} etc) can be used to navigate the
177 list.
178
179 The following commands are available in the Manage Sieve buffer:
180
181 @table @kbd
182
183 @item m
184 @kindex m
185 @findex sieve-activate
186 Activates the currently highlighted script.
187
188 @item u
189 @kindex u
190 @findex sieve-deactivate
191 Deactivates the currently highlighted script.
192
193 @item M-C-?
194 @kindex M-C-?
195 @findex sieve-deactivate-all
196 Deactivates all scripts.
197
198 @item r
199 @kindex r
200 @findex sieve-remove
201 Remove currently highlighted script.
202
203 @item RET
204 @item mouse-2
205 @item f
206 @kindex RET
207 @kindex mouse-2
208 @kindex f
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}).
212
213 @item o
214 @kindex o
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}).
218
219 @item q
220 @kindex q
221 @findex sieve-bury-buffer
222 Bury the Manage Sieve buffer without closing the connection.
223
224 @item ?
225 @item h
226 @kindex ?
227 @kindex h
228 @findex sieve-help
229 Displays help in the minibuffer. 
230
231 @end table
232
233 @node Manage Sieve API
234 @chapter Manage Sieve API
235
236 The @file{sieve-manage.el} library contains low-level functionality
237 for talking to a server with the @sc{managesieve} protocol.
238
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}):
241
242 @table @code
243
244 @item sieve-manage-default-user
245 @vindex sieve-manage-default-user
246 Sets the default username.
247
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}.
251
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).
256
257 @end table
258
259 The API functions include:
260
261 @table @code
262
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.
267
268 @item sieve-manage-opened
269 @findex sieve-manage-opened
270 Check if a server is open or not.
271
272 @item sieve-manage-close
273 @findex sieve-manage-close
274 Close a server connection.
275
276 @item sieve-manage-authenticate
277 @findex sieve-manage-authenticate
278 Authenticate to the server.
279
280 @item sieve-manage-capability
281 @findex sieve-manage-capability
282 Return a list of capabilities the server support.
283
284 @item sieve-manage-listscripts
285 @findex sieve-manage-listscripts
286 List scripts on the server.
287
288 @item sieve-manage-havespace
289 @findex sieve-manage-havespace
290 Returns non-nil iff server have roam for a script of given size.
291
292 @item sieve-manage-getscript
293 @findex sieve-manage-getscript
294 Download script from server.
295
296 @item sieve-manage-putscript
297 @findex sieve-manage-putscript
298 Upload script to server.
299
300 @item sieve-manage-setactive
301 @findex sieve-manage-setactive
302 Indicate which script on the server should be active.
303
304 @end table
305
306 @node Standards
307 @chapter Standards
308
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/}.
313
314 @table @dfn
315
316 @item RFC3028
317 Sieve: A Mail Filtering Language.
318
319 @item draft-martin-managesieve-03
320 A Protocol for Remotely Managing Sieve Scripts
321
322 @end table
323
324
325 @node Index
326 @chapter Index
327 @printindex cp
328
329 @summarycontents
330 @contents
331 @bye
332
333 @c End: