managesieve implements the commands defined by RFC 5804 ((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail messages. A mail is sent to the managesieve user with the command and parameters in the subject header. Sieve scripts are exchanged as mail attachments.

Consult your mail administrator for the name of the managesieve user configured for your installation.

Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands (see note (1) below).

Commands are executed and answered within the namespace of the sending user as denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS lists the scripts within namespace of the user identified by the sender header.

The supported commands are summarised in "Command Summary" below. Generally the responses are self describing. For full details see RFC 5804 - Commands (http://tools.ietf.org/html/rfc5804#section-2).

In these descriptions the following keywords apply:

- sieve-name
    The name of a sieve script enclosed in parentheses, eg: "my script". An empty name is not allowed.
- active-sieve-name
    As sieve-name, except an empty name, eg: "", is allowed.
- old-sieve-name
    As sieve-name
- new-sieve-name
    As sieve-name    
- sieve-script
    A mail attachment recognised as a sieve script. This is the first attachment in a mail satisfying any of these characteristics:
        - A MIME type of "application/sieve"
        - A filename with the suffix ".sieve"
        - A filename with the suffix ".siv"
    Returned sieve-scripts always have the MIME type of "application/sieve"

Command Summary
---------------

CAPABILITY
    Subject:
        CAPABILITY
    Attachments: 
        none
Answers the capabilities of the underlying sieve inplementation.

CHECKSCRIPT
    Subject:
        CHECKSCRIPT
    Attachments: 
        sieve-script
Verifies the attached sieve-script without storing it on the server.

DELETESCRIPT
    Subject: 
        DELETESCRIPT sieve-name
    Attachments: 
        none
Deletes the named sieve script.

GETACTIVE
    Subject: 
        GETACTIVE
    Attachments: 
        none
Answers the active sieve script as an attachment.

GETSCRIPT
    Subject: 
        GETSCRIPT sieve-name
    Attachments: 
        none
Answers the named sieve script as an attachment.

HAVESPACE
    Subject: 
        HAVESPACE sieve-name number
    Attachments: 
        none
Answers OK if there is available space to store a script with the given name of the given size, else NO.

HELP
    Subject: 
        HELP
    Attachments: 
        none
Answers this text.

LISTSCRIPTS
    Subject: 
        LISTSCRIPTS
    Attachments: 
        none
Answers a list of the sieve scripts stored on the server, indicating which, if any, is the active script.

PUTSCRIPT
    Subject: 
        PUTSCRIPT sieve-name
    Attachments: 
        sieve-script
Verifies the attached sieve-script and if there are no errors stores it on the server using the given name.

RENAMESCRIPT
    Subject: 
        RENAMESCRIPT old-sieve-name new-sieve-name
    Attachments: 
        none
Renames the script stored on the server named old-sieve-name to new-sieve-name.

SETACTIVE
    Subject: 
        SETACTIVE active-sieve-name
    Attachments: 
        none
Sets the active script on the server to the given name. Use an empty string, "", to deactivate all scripts.

Notes
-----
1) Some mail servers optionally allow configurations that enable local clients to post without SMTP authentication, such configurations will fail as managesieve requires SMTP authentication in all circumstances. To repeat, users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands.


