dovecot-2.0-pigeonhole: Merged Sieve and ManageSieve for Dovecot...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Jan 13 22:19:59 EET 2010
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/a80a49e6756e
changeset: 1203:a80a49e6756e
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Jan 13 21:07:26 2010 +0100
description:
Merged Sieve and ManageSieve for Dovecot v2.0 into one Pigeonhole package.
diffstat:
.hgignore | 5 +-
AUTHORS | 19 +-
INSTALL | 471 ++-
Makefile.am | 2 +-
NEWS | 230 +
README | 262 +-
TODO | 13 +-
configure.in | 43 +-
doc/example-config/conf.d/Makefile.am | 3 +-
doc/example-config/conf.d/managesieve.conf | 58 +
doc/man/sieve-filter.1 | 7 +-
doc/man/sieve-test.1 | 9 +-
doc/man/sievec.1 | 9 +-
doc/man/sieved.1 | 9 +-
doc/rfc/draft-ietf-sieve-managesieve-09.txt | 2913 +++++++++++++++++
dsieve-config.h.in | 9 -
pigeonhole-config.h.in | 9 +
src/Makefile.am | 15 +-
src/lib-managesieve/Makefile.am | 13 +
src/lib-managesieve/managesieve-parser.c | 675 ++++
src/lib-managesieve/managesieve-parser.h | 192 +
src/lib-managesieve/managesieve-quote.c | 179 +
src/lib-managesieve/managesieve-quote.h | 20 +
src/lib-sieve-tool/Makefile.am | 1 +
src/lib-sieve/plugins/environment/ext-environment-common.c | 4 +-
src/lib-sieve/sieve-config.h | 4 +-
src/lib-sieve/sieve-plugins.c | 2 +-
src/lib-sievestorage/Makefile.am | 22 +
src/lib-sievestorage/sieve-storage-error.h | 32 +
src/lib-sievestorage/sieve-storage-list.c | 113 +
src/lib-sievestorage/sieve-storage-list.h | 34 +
src/lib-sievestorage/sieve-storage-private.h | 64 +
src/lib-sievestorage/sieve-storage-quota.c | 149 +
src/lib-sievestorage/sieve-storage-quota.h | 25 +
src/lib-sievestorage/sieve-storage-save.c | 348 ++
src/lib-sievestorage/sieve-storage-save.h | 27 +
src/lib-sievestorage/sieve-storage-script.c | 622 +++
src/lib-sievestorage/sieve-storage-script.h | 35 +
src/lib-sievestorage/sieve-storage.c | 439 ++
src/lib-sievestorage/sieve-storage.h | 36 +
src/managesieve-login/Makefile.am | 35 +
src/managesieve-login/client-authenticate.c | 225 +
src/managesieve-login/client-authenticate.h | 25 +
src/managesieve-login/client.c | 418 ++
src/managesieve-login/client.h | 49 +
src/managesieve-login/managesieve-login-settings.c | 76 +
src/managesieve-login/managesieve-login-settings.h | 14 +
src/managesieve-login/managesieve-proxy.c | 366 ++
src/managesieve-login/managesieve-proxy.h | 10 +
src/managesieve/Makefile.am | 60 +
src/managesieve/cmd-capability.c | 57 +
src/managesieve/cmd-deletescript.c | 47 +
src/managesieve/cmd-getscript.c | 131 +
src/managesieve/cmd-havespace.c | 59 +
src/managesieve/cmd-listscripts.c | 53 +
src/managesieve/cmd-logout.c | 17 +
src/managesieve/cmd-noop.c | 48 +
src/managesieve/cmd-putscript.c | 443 ++
src/managesieve/cmd-renamescript.c | 44 +
src/managesieve/cmd-setactive.c | 59 +
src/managesieve/main.c | 303 +
src/managesieve/managesieve-client.c | 692 ++++
src/managesieve/managesieve-client.h | 127 +
src/managesieve/managesieve-commands.c | 117 +
src/managesieve/managesieve-commands.h | 49 +
src/managesieve/managesieve-common.h | 29 +
src/managesieve/managesieve-quota.c | 71 +
src/managesieve/managesieve-quota.h | 12 +
src/managesieve/managesieve-settings.c | 164 +
src/managesieve/managesieve-settings.h | 31 +
src/sieve-tools/Makefile.am | 1 +
src/testsuite/Makefile.am | 1 +
tests/extensions/environment/basic.svtest | 4 +-
73 files changed, 10751 insertions(+), 208 deletions(-)
diffs (truncated from 11603 to 300 lines):
diff -r 5c7281bf5556 -r a80a49e6756e .hgignore
--- a/.hgignore Wed Jan 13 09:16:04 2010 +0100
+++ b/.hgignore Wed Jan 13 21:07:26 2010 +0100
@@ -5,7 +5,7 @@
config.guess
dummy-config.h
dummy-config.h.in
-dsieve-config.h
+pigeonhole-config.h
config.log
config.status
config.sub
@@ -56,3 +56,6 @@
src/sieve-tools/sieve-filter
src/testsuite/testsuite
+
+src/managesieve/managesieve
+src/managesieve-login/managesieve-login
diff -r 5c7281bf5556 -r a80a49e6756e AUTHORS
--- a/AUTHORS Wed Jan 13 09:16:04 2010 +0100
+++ b/AUTHORS Wed Jan 13 21:07:26 2010 +0100
@@ -1,13 +1,16 @@
Stephan Bosch <stephan at rename-it.nl>
-This plugin is partly based on the original cmusieve plugin for the Dovecot
-secure IMAP server. It is based only on code relating to interfacing the CMU
-Sieve implementation to Dovecot, meaning that no CMU code is incorporated in
-this implementation.
+This package is built for and partly based on the Dovecot Secure IMAP server
+written by:
-Both the cmusieve plugin and the Dovecot IMAP server are primarily written by:
+Timo Sirainen <tss at iki.fi>.
-Timo Sirainen <tss at iki.fi>
+The LDA Sieve plugin is partly based on the original CMUSieve plugin for the
+Dovecot secure IMAP server. It is based only on code relating to interfacing t
+he CMU Sieve implementation to Dovecot, meaning that no CMU code is
+incorporated in this implementation.
-View the AUTHORS files in the Dovecot and Dovecot-Sieve distributions for other
-contributors.
+The ManageSieve service is a modified version of Dovecot's IMAP service
+implementation.
+
+Grepping 'patch by' from ChangeLog shows up more people.
diff -r 5c7281bf5556 -r a80a49e6756e INSTALL
--- a/INSTALL Wed Jan 13 09:16:04 2010 +0100
+++ b/INSTALL Wed Jan 13 21:07:26 2010 +0100
@@ -1,117 +1,433 @@
Compiling
----------
-
-First of all you'll need to have pre-built Dovecot 1.2 sources available. It's
-also not a good idea to build the plugin against self-compiled Dovecot sources,
-but then actually use a prebuilt binary package of Dovecot. That might work if
-the Dovecot versions are the same, but it's not guaranteed. You can also use
-installed Dovecot headers to compile this package, but then command line tools
-like sievec and sieved will not be compiled. This is also true for the test
-suite.
-
-This package is compiled and configured as follows:
-
-./configure --with-dovecot=../dovecot-1.2
-make
-sudo make install
-
-The --with-dovecot parameter points to your Dovecot sources or, in case you are
-compiling against the headers, to the directory where the dovecot-config file is
-installed.
+=========
If you downloaded this package through Mercurial, you need to execute
./autogen.sh first to build the automake/autoconf structure. This requires
autotools and libtool to be installed.
-Configuring
------------
+Subsequently, the package needs to be configured using the configure script.
+Pigeonhole can either be built against installed Dovecot v2.0 development
+headers and libraties or against a pre-built Dovecot v2.0 source tree. Use
+--with-dovecot=<path> to point to dovecot-config file's directory. There are two
+possibilities where this could exist:
-Configuration is currently mostly identical to the cmusieve module. However, the
-name of the module is 'sieve' and not 'cmusieve'. For a detailed description on
-installing the cmusieve plugin for deliver refer to the dovecot wiki:
+ 1. Dovecot's library directory when compiling against a Dovecot installation:
-http://wiki.dovecot.org/LDA/Sieve
+ If you configured Dovecot with --enable-header-install, you'll have
+ dovecot-config installed in the $prefix/lib/dovecot/ directory. Pigeonhole
+ is then for example configured as follows:
-The following options for the plugin section of the Dovecot config file are new
-when compared to the old CMU Sieve:
+ ./configure --with-dovecot=/usr/local/lib/dovecot
- sieve_extensions =
+ 2. The root directory of a built Dovecot source tree:
- Use this setting to specify which Sieve language extensions are available
- to users. By default, all supported extensions are available, but some
- system administrators may want to disable certain Sieve extensions.
+ The compilation of the Dovecot sources will produce the dovecot-config file
+ in the root of the source tree. Pigeonhole is then for example configured
+ as follows:
- sieve_before =
- sieve_after =
+ ./configure --with-dovecot=../dovecot-2.0/
- This Sieve implementation allows executing multiple Sieve scripts
- sequentially. These two options are used to specify what scripts need to
- be executed before and after the user's script (as specified by the sieve
- option). These settings allow specifying only one path each. However, if
- the path leads to a directory, all the Sieve scripts contained therein are
- executed. The order of execution is determined by the file names, using
- a normal 8bit per-character comparison.
+The following additional parameters are of interest for the configuration of the
+Pigeonhole build:
- After one script terminates, the next script is executed if an implicit or
- explicit "keep" is in effect. Thus, to end all script execution, a script
- must not execute keep and it must cancel the implicit keep, e.g. by
- executing `discard; stop;'. Keep in mind that `fileinto "INBOX"' is not
- the same as a keep action in this context (only for the last script).
+ --with-managesieve=yes
+ Controls whether the ManageSieve is compiled and installed. ManageSieve is
+ compiled by default.
- Just as for executing a single script the normal way, this implementation
- takes care never to duplicate deliveries, forwards or responses. When
- vacation actions are executed multiple times in different scripts, the
- usual error is not triggered: the subsequent duplicate vacation actions
- are simply discarded.
+ --enable-header-install=no
+ Controls whether Pigeonhole will install development headers for building
+ external plugins. The default is not to install development headers.
- Apart from the keep action, all actions triggered in a script in the
- sequence are executed before continuing to the next script. This means
- that when a script in the sequence encounters an error, actions from
- preceeding scripts are not affected. The sequence is broken however,
- meaning that the script execution of the offending script is aborted and
- no further scripts are executed. An implicit keep is executed in stead.
+ --with-unfinished-features=no
+ Controls whether unfinished features and extensions are built. Enabling this
+ will enable the compilation of code that is considered unfinished and highly
+ experimental and may therefore introduce bugs and unexpected behavior.
+ In fact, it may not compile at all. Enable this only when you are eager to
+ test some of the new development functionality.
- sieve_subaddress_sep = +
+After the package is successfully configured, you can compile and install the
+package.
- This setting specifies what separator is used between the :user and :detail
- address parts introduced by the subaddress extension. This may also be a
- sequence of characters (e.g. '--'). The current implementation looks for
- the separator from the left of the localpart and uses the first one
- encountered. The :user part is left of the separator and the :detail part
- is right.
-
+make
+sudo make install
+
+Configuration
+=============
+
+The Pigeonhole package provides the following items:
+
+ - The Sieve plugin for Dovecot's Local Delivery Agent (LDA): This facilitates
+ the actual Sieve filtering upon delivery.
+
+ - The ManageSieve Service: This implements the ManageSieve protocol through
+ which users can remotely manage Sieve scripts on the server.
+
+The functionality of these items is described in more detail in the README file.
+In this file and in this section their configuration is described. Example
+configuration files are provided in the doc/example-config directory of this
+package.
+
+Sieve Plugin - Basic Configuration
+----------------------------------
+
+To use Sieve, you will first need to make sure you are using Dovecot's LDA
+for delivering incoming mail to users' mailboxes. Then, you need to enable the
+Sieve plugin in your dovecot.conf:
+
+protocol lda {
+..
+ # Support for dynamically loadable plugins. mail_plugins is a space separated
+ # list of plugins to load.
+ mail_plugins = sieve # ... other plugins like quota
+}
+
+The sieve plugin recognizes the following configuration options in the plugin
+section of the config file (default values are shown if applicable):
+
+sieve = ~/.dovecot.sieve
+ The path to the user's main active script.
+
+sieve_global_path
+ A path to a global sieve script file, which gets executed ONLY if user's
+ private Sieve script doesn't exist, e.g. /var/lib/dovecot/default.sieve. Be
+ sure to pre-compile this script manually using the sievec command line tool,
+ as explained in the README file.
+
+sieve_global_dir =
+ Directory for :global include scripts for the include extension.
+
+sieve_dir = ~/
+ Directory for :personal include scripts for the include extension.
+
+sieve_extensions =
+ Which Sieve language extensions are available to users. By default, all
+ supported extensions are available, except for deprecated extensions or those
+ that are still under development. Some system administrators may want to
+ disable certain Sieve extensions or enable those that are not available by
+ default. Supported extensions are listed on this page. This setting can use
+ '+' and '-' to specify differences relative to the default. For example
+ `sieve_extensions = +imapflags' will enable the deprecated imapflags extension
+ in addition to all extensions enabled by default.
+
+recipient_delimiter = +
+ The separator that is expected between the :user and :detail address parts
+ introduced by the subaddress extension. This may also be a sequence of
+ characters (e.g. '--'). The current implementation looks for the separator
+ from the left of the localpart and uses the first one encountered. The :user
+ part is left of the separator and the :detail part is right. This setting is
+ also used by Dovecot's LMTP service.
+
For example:
-# ...
+plugin {
+...
+ # The location of the user's active script:
+ sieve = ~/.dovecot.sieve
-protocol lda {
- postmaster_address = postmaster at example.com
+ # If the user has no personal active script (i.e. if the file
+ # indicated in sieve= does not exist), use this one:
+ sieve_global_path = /var/lib/dovecot/sieve/default.sieve
- mail_plugins = sieve
+ # The include extension fetches the :personal scripts from this
+ # directory. When ManageSieve is used, this is also where scripts
+ # are uploaded.
+ sieve_dir = ~/sieve
- # ...
+ # The include extension fetches the :global scripts from this
+ # directory.
+ sieve_global_dir = /var/lib/dovecot/sieve/global/
}
+Sieve Plugin - Configurable Limits
+----------------------------------
+
+sieve_max_script_size = 1M
+ The maximum size of a Sieve script. The compiler will refuse to compile any
+ script larger than this limit.
+
+sieve_max_actions = 32
+ The maximum number of actions that can be performed during a single script
+ execution.
+
+sieve_max_redirects = 4
+ The maximum number of redirect actions that can be performed during a single
+ script execution.
+
+A value of 0 for these settings means that the limit is not enforced.
+
+Sieve Plugin - Per-user Sieve script location
+---------------------------------------------
+
+By default, the Dovecot Sieve plugin looks for the user's Sieve script file in
+the user's home directory (~/.dovecot.sieve). This requires that the home
+directory is set for the user.
+
+If you want to store the script elsewhere, you can override the default using
+the sieve setting, which specifies the path to the user's script file. This can
+be done in two ways:
+
+ 1. Define the sieve setting in the plugin section of dovecot.conf.
+ 2. Return sieve extra field from userdb extra fields.
+
+For example, to use a Sieve script file named <username>.sieve in
+/var/sieve-scripts, use:
+
plugin {
- # The user's own script
- sieve = ~/.dovecot.sieve
+...
- # Global script if user has none
More information about the dovecot-cvs
mailing list