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

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sun Mar 3 19:07:35 EET 2013


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/07983d15ad19
changeset: 1724:07983d15ad19
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sun Mar 03 18:07:30 2013 +0100
description:
Merged changes from Pigeonhole v0.3.

diffstat:

 src/plugins/lda-sieve/lda-sieve-plugin.c |  25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diffs (77 lines):

diff -r f43c7609497c -r 07983d15ad19 src/plugins/lda-sieve/lda-sieve-plugin.c
--- a/src/plugins/lda-sieve/lda-sieve-plugin.c	Sun Mar 03 17:35:37 2013 +0100
+++ b/src/plugins/lda-sieve/lda-sieve-plugin.c	Sun Mar 03 18:07:30 2013 +0100
@@ -372,27 +372,32 @@
 	struct sieve_instance *svinst = srctx->svinst;
 	struct sieve_exec_status *estatus = srctx->scriptenv->exec_status;
 	const char *userlog_notice = "";
-	sieve_sys_error_func_t error_func = sieve_sys_error;
+	sieve_sys_error_func_t error_func, user_error_func; 
 	int ret;
 
+	error_func = user_error_func = sieve_sys_error;
+
 	if ( estatus != NULL && estatus->last_storage != NULL ) {
 		enum mail_error mail_error;
 
 		mail_storage_get_last_error(estatus->last_storage, &mail_error);
 
 		/* Don't bother administrator too much with benign errors */
-		if ( mail_error == MAIL_ERROR_NOSPACE )
+		if ( mail_error == MAIL_ERROR_NOSPACE ) {
 			error_func = sieve_sys_info;
+			user_error_func = sieve_sys_info;
+		}
 	}
 
 	if ( script == srctx->user_script && srctx->userlog != NULL ) {
 		userlog_notice = t_strdup_printf
 			(" (user logfile %s should reveal additional details)", srctx->userlog);
+		user_error_func = sieve_sys_info;
 	}
 
 	switch ( status ) {
 	case SIEVE_EXEC_FAILURE:
-		error_func(svinst,
+		user_error_func(svinst,
 			"execution of script %s failed, but implicit keep was successful%s",
 			sieve_script_location(script), userlog_notice);
 		ret = 1;
@@ -496,10 +501,9 @@
 	struct sieve_error_handler *ehandler = srctx->master_ehandler;
 	bool debug = srctx->mdctx->dest_user->mail_debug;
 	struct sieve_script *last_script = NULL;
-	bool user_script = FALSE;
+	bool user_script = FALSE, more = TRUE, compile_error = FALSE;
 	unsigned int i;
 	int ret = 1;
-	bool more = TRUE;
 	enum sieve_error error;
 
 	/* Start execution */
@@ -535,8 +539,10 @@
 					sieve_script_location(script));
 		}
 
-		if ( (sbin=lda_sieve_open(srctx, script, cpflags, &error)) == NULL )
+		if ( (sbin=lda_sieve_open(srctx, script, cpflags, &error)) == NULL ) {
+			compile_error = TRUE;
 			break;
+		}
 
 		/* Execute */
 
@@ -580,6 +586,13 @@
 
 	ret = sieve_multiscript_finish(&mscript, ehandler, NULL);
 
+	/* Don't log additional messages about compile failure */
+	if ( compile_error && ret == SIEVE_EXEC_FAILURE ) {
+		sieve_sys_info(svinst,
+                        "aborted script execution sequence with successful implicit keep");
+		return 1;
+	}
+
 	return lda_sieve_handle_exec_status(srctx, last_script, ret);
 }
 


More information about the dovecot-cvs mailing list