This is sieve.info, produced by makeinfo version 4.6 from sieve.texi.

INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Sieve: (sieve).               Managing Sieve scripts in Emacs.
END-INFO-DIR-ENTRY

   This file documents the Emacs Sieve package.

   Copyright (C) 2001 Free Software Foundation, Inc.

   Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being "A GNU Manual",
and with the Back-Cover Texts as in (a) below.  A copy of the license
is included in the section entitled "GNU Free Documentation License" in
the Emacs manual.

   (a) The FSF's Back-Cover Text is: "You have freedom to copy and
modify this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development."

   This document is part of a collection distributed under the GNU Free
Documentation License.  If you want to distribute this document
separately from the collection, you can do so by adding a copy of the
license to the document, as described in section 6 of the license.


File: sieve.info,  Node: Top,  Next: Installation,  Up: (dir)

Sieve Support for Emacs
***********************

This manual documents the Emacs Sieve package.

   It is intended as a users manual for Sieve Mode and Manage Sieve, and
as a reference manual for the `sieve-manage' protocol Emacs Lisp API.

   Sieve is a language for server-side filtering of mail.  The language
is documented in RFC 3028.  This manual does not attempt to document
the language, so keep RFC 3028 around.

   A good online Sieve resources is `http://www.cyrusoft.com/sieve/'.

* Menu:

* Installation::          Getting ready to use the package.
* Sieve Mode::            Editing Sieve scripts.
* Managing Sieve::        Managing Sieve scripts on a remote server.
* Examples ::             A few Sieve code snippets.
* Manage Sieve API ::     Interfacing to the Manage Sieve Protocol API.
* Standards::             A summary of RFCs and working documents used.
* Index::                 Function and variable index.


File: sieve.info,  Node: Installation,  Next: Sieve Mode,  Prev: Top,  Up: Top

Installation
************

The Sieve package should come with your Emacs version, and should be
ready for use directly.

   However, to manually set up the package you can put the following
commands in your `~/.emacs':

     (autoload 'sieve-mode "sieve-mode")

     (setq auto-mode-alist (cons '("\\.si\\(v\\|eve\\)\\'" . sieve-mode)
                                 auto-mode-alist))


File: sieve.info,  Node: Sieve Mode,  Next: Managing Sieve,  Prev: Installation,  Up: Top

Sieve Mode
**********

Sieve mode provides syntax-based indentation, font-locking support and
other handy functions to make editing Sieve scripts easier.

   Use `M-x sieve-mode' to switch to this major mode.  This command
runs the hook `sieve-mode-hook'.

   Sieve mode is derived from `c-mode', and is very similar except for
the syntax of comments.  The keymap (`sieve-mode-map') is inherited
from `c-mode', as are the variables for customizing indentation.  Sieve
mode has its own abbrev table (`sieve-mode-abbrev-table') and syntax
table (`sieve-mode-syntax-table').

   In addition to the editing utility functions, Sieve mode also
contains bindings to manage Sieve scripts remotely. *note Managing
Sieve::.

`C-c RET'
     Open a connection to a remote server using the Managesieve
     protocol.

`C-c C-l'
     Upload the Sieve script to the currently open server.



File: sieve.info,  Node: Managing Sieve,  Next: Examples,  Prev: Sieve Mode,  Up: Top

Managing Sieve
**************

Manage Sieve is a special mode used to display Sieve scripts available
on a remote server.  It can be invoked with `M-x sieve-manage RET',
which queries the user for a server and if necessary, user credentials
to use.

   When a server has been succesfully contacted, the Manage Sieve buffer
looks something like:

     Server  : mailserver:2000
     
     2 scripts on server, press RET on a script name edits it, or
     press RET on <new script> to create a new script.
             <new script>
      ACTIVE .sieve
             template.siv

   One of the scripts are highlighted, and standard point navigation
commands (`<up>', `<down>' etc) can be used to navigate the list.

   The following commands are available in the Manage Sieve buffer:

`m'
     Activates the currently highlighted script.

`u'
     Deactivates the currently highlighted script.

`C-M-?'
     Deactivates all scripts.

`r'
     Remove currently highlighted script.

`RET'

`mouse-2'

`f'
     Bury the server buffer and download the currently highlighted
     script into a new buffer for editing in Sieve mode (*note Sieve
     Mode::).

`o'
     Create a new buffer in another window containing the currently
     highlighted script for editing in Sieve mode (*note Sieve Mode::).

`q'
     Bury the Manage Sieve buffer without closing the connection.

`?'

`h'
     Displays help in the minibuffer.



File: sieve.info,  Node: Examples,  Next: Manage Sieve API,  Prev: Managing Sieve,  Up: Top

Examples
********

If you are not familiar with Sieve, this chapter contains a few simple
code snippets that you can cut'n'paste and modify at will, until you
feel more comfortable with the Sieve language to write the rules from
scratch.

   The following complete Sieve script places all messages with a
matching `Sender:' header into the given mailbox.  Many mailing lists
uses this format.  The first line makes sure your Sieve server
understands the `fileinto' command.

     require "fileinto";
     
     if address "sender" "owner-w3-beta@xemacs.org" {
     	fileinto "INBOX.w3-beta";
     }

   A few mailing lists do not use the `Sender:' header, but does
contain some unique identifier in some other header.  The following is
not a complete script, it assumes that `fileinto' has already been
required.

     if header :contains "Delivered-To" "auc-tex@sunsite.dk" {
     	fileinto "INBOX.auc-tex";
     }

   At last, we have the hopeless mailing lists that does not have any
unique identifier and you are forced to match on the `To:' and `Cc'
headers.  As before, this snippet assumes that `fileinto' has been
required.

     if address ["to", "cc"] "kerberos@mit.edu" {
     	fileinto "INBOX.kerberos";
     }


File: sieve.info,  Node: Manage Sieve API,  Next: Standards,  Prev: Examples,  Up: Top

Manage Sieve API
****************

The `sieve-manage.el' library contains low-level functionality for
talking to a server with the MANAGESIEVE protocol.

   A number of user-visible variables exist, which all can be customized
in the `sieve' group (`M-x customize-group RET sieve RET'):

`sieve-manage-default-user'
     Sets the default username.

`sieve-manage-default-port'
     Sets the default port to use, the suggested port number is `2000'.

`sieve-manage-log'
     If non-nil, should be a string naming a buffer where a protocol
     trace is dumped (for debugging purposes).


   The API functions include:

`sieve-manage-open'
     Open connection to managesieve server, returning a buffer to be
     used by all other API functions.

`sieve-manage-opened'
     Check if a server is open or not.

`sieve-manage-close'
     Close a server connection.

`sieve-manage-authenticate'
     Authenticate to the server.

`sieve-manage-capability'
     Return a list of capabilities the server support.

`sieve-manage-listscripts'
     List scripts on the server.

`sieve-manage-havespace'
     Returns non-nil iff server have roam for a script of given size.

`sieve-manage-getscript'
     Download script from server.

`sieve-manage-putscript'
     Upload script to server.

`sieve-manage-setactive'
     Indicate which script on the server should be active.



File: sieve.info,  Node: Standards,  Next: Index,  Prev: Manage Sieve API,  Up: Top

Standards
*********

The Emacs Sieve package implements all or parts of a small but
hopefully growing number of RFCs and drafts documents.  This chapter
lists the relevant ones.  They can all be fetched from
`http://quimby.gnus.org/notes/'.

"RFC3028"
     Sieve: A Mail Filtering Language.

"draft-martin-managesieve-03"
     A Protocol for Remotely Managing Sieve Scripts



File: sieve.info,  Node: Index,  Prev: Standards,  Up: Top

Index
*****

* Menu:

* Install:                               Installation.
* manage remote sieve script:            Sieve Mode.
* Setup:                                 Installation.
* sieve-activate:                        Managing Sieve.
* sieve-bury-buffer:                     Managing Sieve.
* sieve-deactivate:                      Managing Sieve.
* sieve-deactivate-all:                  Managing Sieve.
* sieve-edit-script:                     Managing Sieve.
* sieve-edit-script-other-window:        Managing Sieve.
* sieve-help:                            Managing Sieve.
* sieve-manage:                          Sieve Mode.
* sieve-manage-authenticate:             Manage Sieve API.
* sieve-manage-capability:               Manage Sieve API.
* sieve-manage-close:                    Manage Sieve API.
* sieve-manage-default-port:             Manage Sieve API.
* sieve-manage-default-user:             Manage Sieve API.
* sieve-manage-getscript:                Manage Sieve API.
* sieve-manage-havespace:                Manage Sieve API.
* sieve-manage-listscripts:              Manage Sieve API.
* sieve-manage-log:                      Manage Sieve API.
* sieve-manage-open:                     Manage Sieve API.
* sieve-manage-opened:                   Manage Sieve API.
* sieve-manage-putscript:                Manage Sieve API.
* sieve-manage-setactive:                Manage Sieve API.
* sieve-mode-map:                        Sieve Mode.
* sieve-mode-syntax-table:               Sieve Mode.
* sieve-remove:                          Managing Sieve.
* sieve-upload:                          Sieve Mode.
* upload sieve script:                   Sieve Mode.



Tag Table:
Node: Top1214
Node: Installation2212
Node: Sieve Mode2681
Node: Managing Sieve3650
Node: Examples5155
Node: Manage Sieve API6474
Node: Standards7929
Node: Index8392

End Tag Table
