dovecot-2.2-pigeonhole: doveadm sieve plugin: Implemented comman...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sat Feb 21 17:33:58 UTC 2015


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/7432a425ac63
changeset: 1989:7432a425ac63
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sat Feb 21 17:28:22 2015 +0100
description:
doveadm sieve plugin: Implemented commands for managing Sieve scripts.
This allows performing ManageSieve actions at command line or through doveadm server.

diffstat:

 .hgignore                                              |    1 +
 doc/man/Makefile.am                                    |   30 +-
 doc/man/doveadm-sieve.1.in                             |  122 ++
 doc/man/global-options-formatter.inc                   |   46 +
 doc/man/global-options.inc                             |   21 +
 doc/man/option-A.inc                                   |   27 +
 doc/man/option-S-socket.inc                            |   10 +
 doc/man/option-u-user.inc                              |   20 +
 doc/man/pigeonhole.7.in                                |   16 +-
 doc/man/reporting-bugs.inc                             |    2 +-
 doc/man/sed.sh                                         |   27 +-
 src/lib-sieve/sieve-script.c                           |    6 +-
 src/lib-sieve/sieve-script.h                           |    2 +-
 src/managesieve/cmd-deletescript.c                     |    8 +-
 src/plugins/doveadm-sieve/Makefile.am                  |   15 +-
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-activate.c |  136 +++
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-delete.c   |  115 ++
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-get.c      |   75 +
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-list.c     |   74 +
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-put.c      |  180 ++++
 src/plugins/doveadm-sieve/doveadm-sieve-cmd-rename.c   |   77 +
 src/plugins/doveadm-sieve/doveadm-sieve-cmd.c          |  181 ++++
 src/plugins/doveadm-sieve/doveadm-sieve-cmd.h          |   48 +
 src/plugins/doveadm-sieve/doveadm-sieve-plugin.c       |  720 +----------------
 src/plugins/doveadm-sieve/doveadm-sieve-plugin.h       |   20 +
 src/plugins/doveadm-sieve/doveadm-sieve-sync.c         |  727 +++++++++++++++++
 26 files changed, 1955 insertions(+), 751 deletions(-)

diffs (truncated from 2940 to 300 lines):

diff -r 281a90a91f95 -r 7432a425ac63 .hgignore
--- a/.hgignore	Thu Feb 19 01:00:19 2015 +0100
+++ b/.hgignore	Sat Feb 21 17:28:22 2015 +0100
@@ -56,6 +56,7 @@
 **/.libs
 **/.deps
 
+doc/man/doveadm-sieve.1
 doc/man/sievec.1
 doc/man/sieve-dump.1
 doc/man/sieve-test.1
diff -r 281a90a91f95 -r 7432a425ac63 doc/man/Makefile.am
--- a/doc/man/Makefile.am	Thu Feb 19 01:00:19 2015 +0100
+++ b/doc/man/Makefile.am	Sat Feb 21 17:28:22 2015 +0100
@@ -1,10 +1,13 @@
 pkgsysconfdir = $(sysconfdir)/dovecot
 rundir = ${prefix}/var/run/dovecot
 
+SUFFIXES = .1.in .1 .7.in .7
+
 dist_man1_MANS = \
 	sieved.1
 
 nodist_man1_MANS = \
+	doveadm-sieve.1 \
 	sievec.1 \
 	sieve-dump.1 \
 	sieve-test.1 \
@@ -14,9 +17,15 @@
 	pigeonhole.7
 
 man_includefiles = \
+	$(srcdir)/global-options-formatter.inc \
+	$(srcdir)/global-options.inc \
+	$(srcdir)/option-A.inc \
+	$(srcdir)/option-S-socket.inc \
+	$(srcdir)/option-u-user.inc \
 	$(srcdir)/reporting-bugs.inc
 
 EXTRA_DIST = \
+	doveadm-sieve.1.in \
 	sievec.1.in \
 	sieve-dump.1.in \
 	sieve-test.1.in \
@@ -27,22 +36,11 @@
 
 CLEANFILES = $(nodist_man1_MANS) $(nodist_man7_MANS)
 
-sievec.1: $(srcdir)/sievec.1.in $(man_includefiles) Makefile
+.1.in.1: $(man_includefiles) Makefile
 	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
-		< $(srcdir)/sievec.1.in > sievec.1
+		$(pkglibexecdir) < $< > $@
+.7.in.7: $(man_includefiles) Makefile
+	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
+		$(pkglibexecdir) < $< > $@
 
-sieve-dump.1: $(srcdir)/sieve-dump.1.in $(man_includefiles) Makefile
-	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
-		< $(srcdir)/sieve-dump.1.in > sieve-dump.1
 
-sieve-filter.1: $(srcdir)/sieve-filter.1.in $(man_includefiles) Makefile
-	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
-		< $(srcdir)/sieve-filter.1.in > sieve-filter.1
-
-sieve-test.1: $(srcdir)/sieve-test.1.in $(man_includefiles) Makefile
-	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
-		< $(srcdir)/sieve-test.1.in > sieve-test.1
-
-pigeonhole.7: $(srcdir)/pigeonhole.7.in $(man_includefiles) Makefile
-	$(SHELL) $(srcdir)/sed.sh $(srcdir) $(rundir) $(pkgsysconfdir) \
-		< $(srcdir)/pigeonhole.7.in > pigeonhole.7
diff -r 281a90a91f95 -r 7432a425ac63 doc/man/doveadm-sieve.1.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/man/doveadm-sieve.1.in	Sat Feb 21 17:28:22 2015 +0100
@@ -0,0 +1,122 @@
+.\" Copyright (c) 2010-2015 Pigeonhole authors, see the included COPYING file
+.TH DOVEADM\-SIEVE 1 "2015-02-21" "Pigeonhole v0.4 for Dovecot v2.2" "Pigeonhole"
+.SH NAME
+doveadm\-sieve \- Commands related to handling Sieve scripts
+.\"------------------------------------------------------------------------
+.SH SYNOPSIS
+.BR doveadm " [" \-Dv "] [" \-f
+.IR formatter "] " sieve_cmd " [" options "] [" arguments ]
+.\"------------------------------------------------------------------------
+.SH DESCRIPTION
+.PP
+The
+.B doveadm sieve
+commands are part of the Pigeonhole Project (\fBpigeonhole\fR(7)), which adds
+Sieve (RFC 5228) and ManageSieve (RFC 5804) support to the Dovecot secure IMAP
+and POP3 server (\fBdovecot\fR(1)). The
+.B doveadm sieve
+commands can be used to manage Sieve filtering.
+.\"------------------------------------------------------------------------
+ at INCLUDE:global-options-formatter@
+.\" --- command specific options --- "/.
+.PP
+Command specific
+.IR options :
+.\"-------------------------------------
+ at INCLUDE:option-A@
+.\"-------------------------------------
+ at INCLUDE:option-S-socket@
+.\"-------------------------------------
+ at INCLUDE:option-u-user@
+.\"------------------------------------------------------------------------
+.SH ARGUMENTS
+.TP
+.I scriptname
+Is the name of a
+.IR Sieve\ script ,
+as visible to ManageSieve clients. 
+.\"------------------------------------------------------------------------
+.SH COMMANDS
+.SS sieve put
+.B doveadm sieve put
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.RB [ \-a ]
+.IR scriptname
+.PP
+This command puts one new Sieve script in the script storage. The script
+is read from standard input. If the script compiles successfully, it is stored
+under the provided 
+.IR scriptname\ . 
+If the
+.B \-a
+option is present, the Sieve script is subsequently marked as the active script
+for execution at delivery.
+.\"------------------------------------------------------------------------
+.SS sieve get
+.B doveadm sieve get
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.I scriptname
+.PP
+This command retrieves the Sieve script named
+.IR scriptname .
+.\"------------------------------------------------------------------------
+.SS sieve delete
+.B doveadm sieve delete
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.RB [ \-a ]
+.IR scriptname\  ...
+.PP
+This command deletes one or more Sieve scripts. The deleted script may not be the
+active script, unless the 
+.B \-a
+option is present.
+.\"------------------------------------------------------------------------
+.SS sieve list
+.B doveadm sieve list
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.I scriptname
+.PP
+Use this command to get an overview of existing Sieve scripts.
+.\"------------------------------------------------------------------------
+.SS sieve rename
+.B doveadm sieve rename
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.I old_name
+.I new_name
+.PP
+The
+.B sieve rename
+command is used to rename the Sieve script
+.I old_name
+to
+.IR new_name .
+.\"------------------------------------------------------------------------
+.SS sieve activate
+.B doveadm sieve activate
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.IR scriptname
+.PP
+This command marks the Sieve script named 
+.I scriptname
+as the active script for execution at delivery.
+.\"------------------------------------------------------------------------
+.SS sieve deactivate
+.B doveadm sieve deactivate
+[\fB\-A\fP|\fB\-u\fP \fIuser\fP]
+[\fB\-S\fP \fIsocket_path\fP]
+.I scriptname
+.PP
+This command deactivates Sieve processing.
+.\"------------------------------------------------------------------------
+ at INCLUDE:reporting-bugs@
+.\"------------------------------------------------------------------------
+.SH SEE ALSO
+.BR doveadm (1)
+.BR dovecot\-lda (1),
+.BR pigeonhole (7)
diff -r 281a90a91f95 -r 7432a425ac63 doc/man/global-options-formatter.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/man/global-options-formatter.inc	Sat Feb 21 17:28:22 2015 +0100
@@ -0,0 +1,46 @@
+.SH OPTIONS
+Global
+.BR doveadm (1)
+.IR options :
+.TP
+.B \-D
+Enables verbosity and debug messages.
+.TP
+.BI \-f\  formatter
+Specifies the
+.I formatter
+for formatting the output.
+Supported formatters are:
+.RS
+.TP
+.B flow
+prints each line with
+.IB key = value
+pairs.
+.TP
+.B pager
+prints each
+.IR key :\  value
+pair on its own line and separates records with form feed character
+.RB ( ^L ).
+.TP
+.B tab
+prints a table header followed by tab separated value lines.
+.TP
+.B table
+prints a table header followed by adjusted value lines.
+.RE
+.TP
+.BI \-o\  setting = value
+Overrides the configuration
+.I setting
+from
+.I @pkgsysconfdir@/dovecot.conf
+and from the userdb with the given
+.IR value .
+In order to override multiple settings, the
+.B \-o
+option may be specified multiple times.
+.TP
+.B \-v
+Enables verbosity, including progress counter.
diff -r 281a90a91f95 -r 7432a425ac63 doc/man/global-options.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/man/global-options.inc	Sat Feb 21 17:28:22 2015 +0100
@@ -0,0 +1,21 @@
+.SH OPTIONS
+Global
+.BR doveadm (1)
+.IR options :
+.TP
+.B \-D
+Enables verbosity and debug messages.
+.TP
+.BI \-o\  setting = value
+Overrides the configuration
+.I setting
+from
+.I @pkgsysconfdir@/dovecot.conf
+and from the userdb with the given
+.IR value .
+In order to override multiple settings, the
+.B \-o
+option may be specified multiple times.
+.TP
+.B \-v
+Enables verbosity, including progress counter.
diff -r 281a90a91f95 -r 7432a425ac63 doc/man/option-A.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/man/option-A.inc	Sat Feb 21 17:28:22 2015 +0100
@@ -0,0 +1,27 @@
+.TP
+.B \-A
+If the
+.B \-A
+option is present, the
+.I command
+will be performed for all users.
+Using this option in combination with system users from
+.B userdb { driver = passwd }
+is not recommended, because it contains also users with a lower UID than
+the one configured with the
+.I first_valid_uid
+setting.
+.sp
+When the SQL userdb module is used make sure that the
+.I iterate_query
+setting in
+.I @pkgsysconfdir@/dovecot\-sql.conf.ext
+matches your database layout.
+When using the LDAP userdb module, make sure that the
+.IR iterate_attrs " and " iterate_filter
+settings in
+.I @pkgsysconfdir@/dovecot-ldap.conf.ext


More information about the dovecot-cvs mailing list