ManageSieve Download and Installation
=====================================

 * <ManageSieve Installation for Dovecot v1.0> [ManageSieve.Install.1.0.txt]
   has a separate page.

Downloading
-----------

Tarball releases
----------------

The latest released versions of the <ManageSieve.txt> implementation for
Dovecot can be downloaded from the following locations:

 * Dovecot v1.1: http://www.rename-it.nl/dovecot/1.1/
    * Patch filenames look as follows:
      *'dovecot-1.1.'*'X'*'-managesieve-'*'<version>'*'.diff.gz'* Package
      filenames look as
      follows:*'dovecot-1.1-managesieve-'*'<version>'*'.tar.gz'*
 * Dovecot v1.2: http://www.rename-it.nl/dovecot/1.2/
    * Patch filenames look as follows:
      *'dovecot-1.2.'*'X'*'-managesieve-'*'<version>'*'.diff.gz'* Package
      filenames look as
      follows:*'dovecot-1.2-managesieve-'*'<version>'*'.tar.gz'*

The tarball releases are signed with public key 0x3DFBB4F4, which can be found
at wwwkeys.pgp.net.

Mercurial repositories
----------------------

The <ManageSieve.txt> implementation is maintained in a set of Mercurial
repositories, just like Dovecot itself. If you need to use the very latest
version, even before it is released as a tarball, you can download it through
Mercurial. The <ManageSieve.txt> repositories for the various Dovecot versions
are publicly available at:

---%<-------------------------------------------------------------------------
http://hg.rename-it.nl/
---%<-------------------------------------------------------------------------

For each Dovecot version, there is a dovecot-1.X-managesieve and a
dovecot-1.X-managesieve-patch repository. The -patch repositories contain the
patches against the various dovecot versions. These are so-called Mercurial
Queues (MQ) repositories. This provides an easy (quilt-like) means to manage
patches over an upstream source repository like the one that exists for
Dovecot. The patches are managed in a repository called 'patches' below the .hg
directory in your main repository. Currently, these MQ repositories only have
the managesieve.patch, which is the actual patch that is refreshed and released
each time Timo makes a new Dovecot release. The dovecot-1.x-managesieve
repositories contain the actual <ManageSieve.txt> implementation.

Using these repositories is explained in the next two sections that deal with
patching the Dovecot tree and compiling Dovecot and <ManageSieve.txt>.

Patching Dovecot
----------------

Applying the patch to Dovecot varies a little between the different versions.
Downloading from Mercurial is a special case.

The <ManageSieve.txt> implementations for v1.1 and v1.2 consist of a patch in
'.diff.gz' format and a separate '.tar.gz' package. You first need to patch and
compile the Dovecot sources. Applying the patch is achieved by executing the
following command line inside the dovecot source tree (''../patchfile.diff.gz''
must be substituted with the location of the patch file you downloaded):

---%<-------------------------------------------------------------------------
gzip -dc ../pathfile.diff.gz | patch -p1
---%<-------------------------------------------------------------------------

Once patched, you can compile Dovecot using the usual <build process>
[CompilingSource.txt]. So you do not need autotools.

Mercurial
---------

The following command sequence shows how to incorporate the <ManageSieve.txt>
patch repository in a freshly cloned dovecot-1.1 tree:

---%<-------------------------------------------------------------------------
hg clone http://hg.dovecot.org/dovecot-1.1
cd dovecot-1.1
hg clone http://hg.rename-it.nl/dovecot-1.1-managesieve-patch .hg/patches
hg qpush
---%<-------------------------------------------------------------------------

The procedure is identical for the other dovecot versions.

When updating the dovecot tree it is important to unapply all patches before
performing ''hg pull'' on the dovecot tree:

---%<-------------------------------------------------------------------------
hg qpop --all
hg pull
hg update
hg qpush
---%<-------------------------------------------------------------------------

This otherwise results in a multi-head situation which can be resolved using a
''hg rollback'' or using ''hg qpop --all'' afterwards, which should gracefully
clean up the situation (never merge the heads!).

Updating the patch repository works as follows:

---%<-------------------------------------------------------------------------
hg qpop --all
hg -R .hg/patches pull
hg -R .hg/patches update
hg qpush
---%<-------------------------------------------------------------------------

After ''hg qpush'', the dovecot repository is patched and can be compiled using
the usual Mercurial <build process> [CompilingSource.txt] (don't forget
./autogen.sh).

Compiling
---------

The first prerequisite for compiling the <ManageSieve.txt> service is a patched
and compiled dovecot tree, as explained in the previous section. Note that the
service will compile against an unpatched dovecot tree, but keep in mind that
Dovecot will not know about the existence of <ManageSieve.txt> without the
patch. The second prerequisite is a compiled dovecot-sieve source tree.
Compiling the Sieve plugin is described <here> [LDA.Sieve.txt].

Now that you have both a compiled dovecot and a compiled dovecot-sieve source
tree, you can continue building the <ManageSieve.txt> service. You can either
unpack the '.tar.gz' package somewhere or clone the Mercurial repository. When
you have cloned the repository, you must first execute ''./autogen.sh'' inside
the source tree. For both alternatives the following commands subsequently need
to be executed inside the source tree:

---%<-------------------------------------------------------------------------
./configure --with-dovecot=<dovecot source tree>
--with-dovecot-sieve=<dovecot-sieve source tree>
make
sudo make install
---%<-------------------------------------------------------------------------

The parameters to './configure' represent the following:

 * --with-dovecot=<path>
    * Path to the compiled dovecot tree
 * --with-dovecot-sieve=<path>
    * Path to the compiled dovecot-sieve tree

(This file was created from the wiki on 2011-05-11 04:42)
