# Installing Sieve

This section assumes that you compiled Cyrus with sieve support. If you specified `--disable-sieve` when running `./configure`, you did NOT compile the server with sieve support.

A brief introduction to Sieve at is available from Cyrusoft International.

### Configure outgoing mail

Some Sieve actions (redirect, vacation) can send outgoing mail.

You'll need to make sure that "`lmtpd`" can send outgoing messages. Currently, it invokes "`/usr/lib/sendmail`" by default to send messages. Change this by adding a line like:

       sendmail: /usr/sbin/sendmail

in your "`/etc/imapd.conf`". If you're using Postfix or another MTA, make sure that the sendmail referenced in "`/etc/imapd.conf`" is Sendmail-compatible.

### Managing Sieve Scripts

Since Cyrus is based around the concept of a sealed-server, the normal way for users to manipulate Sieve scripts is through the "`installsieve`" utility.

If, for some reason, you do have user home directories on the server, you can use the "`sieveusehomedir`" option and have the sieve script stored in the home directory of the user as "`~/.sieve`".

### Testing the sieve server

1. The Sieve server, "`timsieved`", is used for transporting user Sieve scripts to the sealed IMAP server. It is incompatible with the "`sieveusehomedir`" option. It is named after the principal author, Tim Martin, who desperately wanted something named after him in the Cyrus distribution.

2. From your normal account, telnet to the sieve port on the server you're setting up:

          telnet foobar sieve

   If your server is running, you'll get a message similar to the following one:

          Trying 128.2.10.192...
          Connected to foobar.andrew.cmu.edu.
          Escape character is '^]'.
          "CMU Experimental Sieved version 0.99" "SASL={GSSAPI, ANONYMOUS, PLAIN, KERBEROS_V4}"

   Any message other than one similar to the one above means there is a problem. Make sure all of authentication methods you wish to support are listed. This list should be identical to the one listed by "`imapd`" earlier. Next terminate the connection, by typing "`logout`".

3. Next test authenticating to the sieve server. To do this run the "`installsieve`" utility. You must specify the server. You may have to specify the port if you run this utility from a different machine without the "sieve" entry in "`/etc/services`". To specify the port use the "`-p [port]`" switch.

         "installsieve foobar"

   This should produce the message "`Authentication failed`" with a description of the failure if there was a problem.

4. Next you should attempt to place a sieve script on the server. To do this create a file named "`myscript.script`" with the following lines. Replace "`foo@example.org`" with an email address you can send mail from, but that is not the one you are working on now.

         require ["reject","fileinto"];

         if address :is :all "From" "foo@example.org"
         {
           reject "testing";
         }

   To place this script on the server run the following command "`installsieve -i myscript.script foobar`" This should place your script on the server and make it the active script.

5. Test that the sieve script is actually run from deliver. Send a message to the address you're working on from the address mentioned in the sieve script. The message should be rejected.

last modified: $Date: 2001/01/05 01:59:03 $