dovecot-2.2-pigeonhole: Merged changes from Pigeonhole v0.3.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sun Sep 23 18:15:06 EEST 2012


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/7d171ec86a4c
changeset: 1686:7d171ec86a4c
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sun Sep 23 17:14:58 2012 +0200
description:
Merged changes from Pigeonhole v0.3.

diffstat:

 .hgsigs                                                        |   2 +
 .hgtags                                                        |   2 +
 NEWS                                                           |  23 ++++
 doc/man/sieve-filter.1.in                                      |  21 +++-
 src/lib-sieve-tool/sieve-tool.c                                |  14 ++-
 src/lib-sieve-tool/sieve-tool.h                                |   2 +-
 src/lib-sieve/plugins/include/ext-include-binary.c             |   1 -
 src/lib-sieve/plugins/mailbox/tag-mailbox-create.c             |   2 +-
 src/lib-sieve/plugins/spamvirustest/ext-spamvirustest-common.c |  47 +++++----
 src/lib-sieve/plugins/spamvirustest/tst-spamvirustest.c        |   2 +
 src/sieve-tools/sieve-dump.c                                   |   2 +-
 src/sieve-tools/sieve-filter.c                                 |   2 +-
 src/sieve-tools/sieve-test.c                                   |   2 +-
 src/sieve-tools/sievec.c                                       |   2 +-
 src/testsuite/testsuite.c                                      |   2 +-
 15 files changed, 87 insertions(+), 39 deletions(-)

diffs (truncated from 393 to 300 lines):

diff -r ead2e76425bf -r 7d171ec86a4c .hgsigs
--- a/.hgsigs	Thu Sep 20 01:22:29 2012 +0200
+++ b/.hgsigs	Sun Sep 23 17:14:58 2012 +0200
@@ -5,3 +5,5 @@
 873baa85e2202f45a9c14fa21cccedc60f3715bc 0 iQEcBAABAgAGBQJOx9MCAAoJEATWKx49+7T09aUIANIKsuzM3bGhtGJ/UPIwzpOu39lEGCmHah6dMa+bDOoCZhuhASDdTuvRKXTfGC57GMu+NzBK6I7heFiPD3E4VTI4xOCK1azJ9G4SsiDEkQThucXqWBKDjPB0RgOEf6iefAkslXIU3cprJgattwpeXbUKiHjBhoYJFJ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JEATWKx49+7T0g/IH/3qqQemBP62Y+Wzo67DruphrJ5HSlIX4Uw/O4rOjrk8dWSMrsui5jFy4LXig+CR1dfY4RS0izTxsAiNhTACuavMfGHiYBKQW6UwIDlKECVBxbQyjB7v2C3FKPj9K9QReiYACSeB1RhQBnpbcvioif9H62VI5SKE6rjXyky6fDAxtbjhySb+nPDtV4HmV7ukcfDc3bxwcZkz9XXKoNmPWw8r34Z/RwxWbbWr8xUwW3+9LDB2Oz6PRyYP5S8EcNNYjk3ai2Llh0xuJGLQbpulhmjYDJmk20TkpLCFAfsYq1qW3yed9lL88CcFH4LDb9WA0LNs+7PfbmY/m8CX7JwUmHB8=
+64474c35967852bc452f71bc099ec3f8ded0369a 0 iQEcBAABAgAGBQJQWMvhAAoJEATWKx49+7T0NrYH/2PQuuFqzlku+NG8Iw0UN2yeDEML+2n1xG31ud7m3sNWw8lX+03gEd+LU8+LygHJJ0IAde/jBYRBbC8zj9UXDl3v5FIRwhcvGnllBCMMH7motfg+aLrCR/xs+0jV/AqpRin1VILHYFaB9UFP5PUgvJJiCUniQWoe+r41gra1hRA7OK3923YOOi9t4zJxoat7e0OMhc0IcdB7n3iQmyicbb8izKw/UvR2tR3T7fVcEl6u1LlbGaojtJA03V1L+a8QkmltiurD9VNmiHz++bGGJlA7LSmVYBq7BeC1lDnXUGO9ryZgln6aXRwUS0VaTI51F9gSMw+0UDJCwA5yBKqYyR8=
diff -r ead2e76425bf -r 7d171ec86a4c .hgtags
--- a/.hgtags	Thu Sep 20 01:22:29 2012 +0200
+++ b/.hgtags	Sun Sep 23 17:14:58 2012 +0200
@@ -11,3 +11,5 @@
 873baa85e2202f45a9c14fa21cccedc60f3715bc 0.2.5
 fe7bd7ee6c2e33e38515cbeca7642135db8dea4b 0.3.0
 e9ed5d5cef4b3b27ac5d980b3e4aeadaabeeeae2 0.3.1
+265061e0d3f4b3d8f9e4f0fc0b978cd51f84690d 0.3.2
+64474c35967852bc452f71bc099ec3f8ded0369a 0.3.3
diff -r ead2e76425bf -r 7d171ec86a4c NEWS
--- a/NEWS	Thu Sep 20 01:22:29 2012 +0200
+++ b/NEWS	Sun Sep 23 17:14:58 2012 +0200
@@ -1,3 +1,26 @@
+v0.3.3 18-09-2012 Stephan Bosch <stephan at rename-it.nl>
+
+	- Fixed compile against installed Dovecot headers. This was broken by the
+	  ld.gold fix in the previous release.
+
+v0.3.2 18-09-2012 Stephan Bosch <stephan at rename-it.nl>
+
+	+ sieve-refilter tool: improved man page documentation by explicitly
+	  specifying the syntax used for mailbox arguments.
+	+ Sieve: spamtest and virustest extensions: improved trace debugging of score
+	  calculation.
+	+ Sieve: made error messages about exceeding the maximum number of actions
+	  more verbose.
+	- Sieve tools: fixed problems with running as root: sievec and sieve-dump now
+	  ignore mail_uid and mail_gid settings when run as root.
+	- Sieve: fixed bug in action accounting (for limit checking): increase action
+	  instance count only when an action is actually created.
+	- Sieve: include extension: fixed namespace separation of :global and
+	  :personal scripts.
+	- ManageSieve: fixed segfault bug triggered by CHECKSCRIPT command.
+	- Fixed linking with ld.gold.
+	- Fixed several Clang compile warnings and a few potential bugs.
+
 v0.3.1 25-05-2012 Stephan Bosch <stephan at rename-it.nl>
 
 	* Added support for retrieving Sieve scripts from dict lookup. This means that
diff -r ead2e76425bf -r 7d171ec86a4c doc/man/sieve-filter.1.in
--- a/doc/man/sieve-filter.1.in	Thu Sep 20 01:22:29 2012 +0200
+++ b/doc/man/sieve-filter.1.in	Sun Sep 23 17:14:58 2012 +0200
@@ -92,7 +92,8 @@
 is equal to the \fIsource\-mailbox\fP by default. Specifying a different folder
 will have the effect of moving (or copying if \fB\-W\fP is omitted) all kept
 messages to the indicated folder, instead of just leaving them in the
-\fIsource\-mailbox\fP.
+\fIsource\-mailbox\fP. Refer to the explanation of the \fIsource\-mailbox\fP
+argument for more information on mailbox naming.
 .TP
 .BI \-q\  output\-mailbox\  \fB[not\ implemented\ yet]\fP
 Store outgoing e\-mail into the indicated \fIoutput\-mailbox\fP. By default,
@@ -153,9 +154,18 @@
 into a new binary.
 .TP
 .I source\-mailbox
-The name of the source mailbox containing the messages that the Sieve filter
-will act upon. This mailbox is not modified unless the \fB\-W\fP option is
-specified.
+Specifies the source mailbox containing the messages that the Sieve filter will
+act upon.
+
+This is the name of a mailbox, as visible to IMAP clients, except in UTF-8
+format. The hierarchy separator between a parent and child mailbox is commonly
+.RB \(aq / \(aq
+or
+.RB \(aq . \(aq,
+but this depends on your selected mailbox storage format and
+namespace configuration. The mailbox names may also require a namespace prefix.
+
+This mailbox is not modified unless the \fB\-W\fP option is specified.
 .TP
 .I discard\-action
 Specifies what is done with messages in the \fIsource\-mailbox\fP that where not
@@ -169,7 +179,8 @@
 .TP
 .BI move\  mailbox
 Move discarded messages to the indicated \fImailbox\fP. This is for instance
-useful to move messages to a Trash mailbox.
+useful to move messages to a Trash mailbox. Refer to the explanation of
+the \fIsource\-mailbox\fP argument for more information on mailbox naming.
 .TP
 .B delete
 Flag discarded messages as \\DELETED.
diff -r ead2e76425bf -r 7d171ec86a4c src/lib-sieve-tool/sieve-tool.c
--- a/src/lib-sieve-tool/sieve-tool.c	Thu Sep 20 01:22:29 2012 +0200
+++ b/src/lib-sieve-tool/sieve-tool.c	Sun Sep 23 17:14:58 2012 +0200
@@ -112,14 +112,14 @@
 		home == NULL || *home == '\0' ) {
 
 		if ((pw = getpwuid(process_euid)) != NULL) {
-            user = pw->pw_name;
+			user = pw->pw_name;
 			home = pw->pw_dir;
 		}
 	}
 
 	if ( username_r != NULL ) {
 		if ( user == NULL || *user == '\0' ) {
-            i_fatal("couldn't lookup our username (uid=%s)",
+			i_fatal("couldn't lookup our username (uid=%s)",
 				dec2str(process_euid));
 		}
 
@@ -216,7 +216,7 @@
 }
 
 struct sieve_instance *sieve_tool_init_finish
-(struct sieve_tool *tool, bool init_mailstore)
+(struct sieve_tool *tool, bool init_mailstore, bool preserve_root)
 {
 	enum mail_storage_service_flags storage_service_flags =
 		MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR |
@@ -238,9 +238,15 @@
 		if ( tool->homedir != NULL )
 			i_free(tool->homedir);
 		tool->homedir = i_strdup(homedir);
-	} else
+
+		if ( preserve_root ) {
+			storage_service_flags |=
+				MAIL_STORAGE_SERVICE_FLAG_NO_RESTRICT_ACCESS;
+		}
+	} else {
 		storage_service_flags |=
 			MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
+	}
 
 	if ( !init_mailstore )
 		storage_service_flags |=
diff -r ead2e76425bf -r 7d171ec86a4c src/lib-sieve-tool/sieve-tool.h
--- a/src/lib-sieve-tool/sieve-tool.h	Thu Sep 20 01:22:29 2012 +0200
+++ b/src/lib-sieve-tool/sieve-tool.h	Sun Sep 23 17:14:58 2012 +0200
@@ -30,7 +30,7 @@
 int sieve_tool_getopt(struct sieve_tool *tool);
 
 struct sieve_instance *sieve_tool_init_finish
-	(struct sieve_tool *tool, bool init_mailstore);
+	(struct sieve_tool *tool, bool init_mailstore, bool preserve_root);
 
 void sieve_tool_deinit(struct sieve_tool **_tool);
 
diff -r ead2e76425bf -r 7d171ec86a4c src/lib-sieve/plugins/include/ext-include-binary.c
--- a/src/lib-sieve/plugins/include/ext-include-binary.c	Thu Sep 20 01:22:29 2012 +0200
+++ b/src/lib-sieve/plugins/include/ext-include-binary.c	Sun Sep 23 17:14:58 2012 +0200
@@ -302,7 +302,6 @@
 				"include: failed to find block %d for included script "
 				"from dependency block %d of binary %s", inc_block_id, block_id,
 				sieve_binary_path(sbin));
-
 			return FALSE;
 		}
 
diff -r ead2e76425bf -r 7d171ec86a4c src/lib-sieve/plugins/mailbox/tag-mailbox-create.c
--- a/src/lib-sieve/plugins/mailbox/tag-mailbox-create.c	Thu Sep 20 01:22:29 2012 +0200
+++ b/src/lib-sieve/plugins/mailbox/tag-mailbox-create.c	Sun Sep 23 17:14:58 2012 +0200
@@ -156,7 +156,7 @@
 	}
 
 	/* Try opening again */
-	if ( mailbox_sync(trans->box, 0) < 0 ) {
+	if ( mailbox_open(trans->box) < 0 ) {
 		/* Failed definitively */
 		sieve_act_store_get_storage_error(aenv, trans);
 		return FALSE;
diff -r ead2e76425bf -r 7d171ec86a4c src/lib-sieve/plugins/spamvirustest/ext-spamvirustest-common.c
--- a/src/lib-sieve/plugins/spamvirustest/ext-spamvirustest-common.c	Thu Sep 20 01:22:29 2012 +0200
+++ b/src/lib-sieve/plugins/spamvirustest/ext-spamvirustest-common.c	Sun Sep 23 17:14:58 2012 +0200
@@ -457,7 +457,6 @@
 	const struct sieve_message_data *msgdata = renv->msgdata;
 	struct sieve_message_context *msgctx = renv->msgctx;
 	struct ext_spamvirustest_message_context *mctx;
-	const char *ext_name = sieve_extension_name(ext);
 	regmatch_t match_values[2];
 	const char *header_value, *error;
 	const char *status = NULL, *max = NULL;
@@ -470,7 +469,7 @@
 	 */
 	if ( ext_data == NULL ) {
 		sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-			"%s: extension not configured", ext_name);
+			"error: extension not configured");
 		return "0";
 	}
 
@@ -504,8 +503,8 @@
 				(msgdata->mail, max_header->header_name, &header_value) < 0 ||
 				header_value == NULL ) {
 				sieve_runtime_trace(renv,  SIEVE_TRLVL_TESTS,
-					"%s: header '%s' not found in message",
-					ext_name, max_header->header_name);
+					"header '%s' not found in message",
+					max_header->header_name);
 				goto failed;
 			}
 
@@ -514,16 +513,16 @@
 				if ( regexec(&max_header->regexp, header_value, 2, match_values, 0)
 					!= 0 ) {
 					sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-						"%s: regexp for header '%s' did not match "
-						"on value '%s'", ext_name, max_header->header_name, header_value);
+						"regexp for header '%s' did not match "
+						"on value '%s'", max_header->header_name, header_value);
 					goto failed;
 				}
 
 				max = _regexp_match_get_value(header_value, 1, match_values, 2);
 				if ( max == NULL ) {
 					sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-						"%s: regexp did not return match value "
-						"for string '%s'", ext_name, header_value);
+						"regexp did not return match value "
+						"for string '%s'", header_value);
 					goto failed;
 				}
 			} else {
@@ -532,7 +531,7 @@
 
 			if ( !ext_spamvirustest_parse_decimal_value(max, &max_value, &error) ) {
 				sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-					"%s: failed to parse maximum value: %s", ext_name, error);
+					"failed to parse maximum value: %s", error);
 				goto failed;
 			}
 		} else {
@@ -541,7 +540,7 @@
 
 		if ( max_value == 0 ) {
 			sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-				"%s: max value is 0", ext_name);
+				"error: max value is 0");
 			goto failed;
 		}
 	} else {
@@ -557,8 +556,8 @@
 		(msgdata->mail, status_header->header_name, &header_value) < 0 ||
 		header_value == NULL ) {
 		sieve_runtime_trace(renv,  SIEVE_TRLVL_TESTS,
-			"%s: header '%s' not found in message",
-			ext_name, status_header->header_name);
+			"header '%s' not found in message",
+			status_header->header_name);
 		goto failed;
 	}
 
@@ -567,16 +566,16 @@
 		if ( regexec(&status_header->regexp, header_value, 2, match_values, 0)
 			!= 0 ) {
 			sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-				"%s: regexp for header '%s' did not match on value '%s'",
-			ext_name, status_header->header_name, header_value);
+				"regexp for header '%s' did not match on value '%s'",
+				status_header->header_name, header_value);
 			goto failed;
 		}
 
 		status = _regexp_match_get_value(header_value, 1, match_values, 2);
 		if ( status == NULL ) {
 			sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-				"%s: regexp did not return match value for string '%s'",
-				ext_name, header_value);
+				"regexp did not return match value for string '%s'",
+				header_value);
 			goto failed;
 		}
 	} else {
@@ -588,8 +587,8 @@
 		if ( !ext_spamvirustest_parse_decimal_value
 			(status, &status_value, &error) ) {
 			sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-				"%s: failed to parse status value '%s': %s",
-				ext_name, status, error);
+				"failed to parse status value '%s': %s",
+				status, error);
 			goto failed;
 		}
 		break;
@@ -597,8 +596,8 @@
 		if ( !ext_spamvirustest_parse_strlen_value
 			(status, &status_value, &error) ) {
 			sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS,
-				"%s: failed to parse status value '%s': %s",
-				ext_name, status, error);
+				"failed to parse status value '%s': %s",
+				status, error);
 			goto failed;
 		}
 		break;
@@ -618,8 +617,8 @@
 


More information about the dovecot-cvs mailing list