dovecot-2.0-pigeonhole: Sieve plugin: only refer to user log for...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sun Sep 5 18:53:24 EEST 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/ed7c367576c6
changeset: 1411:ed7c367576c6
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sun Sep 05 17:53:16 2010 +0200
description:
Sieve plugin: only refer to user log for compile error details when there is actually a compile error.

diffstat:

 src/plugins/lda-sieve/lda-sieve-plugin.c |  29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diffs (57 lines):

diff -r f6fbbb9d7f2c -r ed7c367576c6 src/plugins/lda-sieve/lda-sieve-plugin.c
--- a/src/plugins/lda-sieve/lda-sieve-plugin.c	Sun Sep 05 16:27:06 2010 +0200
+++ b/src/plugins/lda-sieve/lda-sieve-plugin.c	Sun Sep 05 17:53:16 2010 +0200
@@ -275,16 +275,15 @@
 		if ( *error_r == SIEVE_ERROR_NOT_FOUND ) {
 			if ( debug )
 				sieve_sys_debug(svinst, "script file %s is missing", script_path);
+		} else if ( *error_r == SIEVE_ERROR_NOT_VALID && 
+			script_path == srctx->user_script && srctx->userlog != NULL ) {
+			sieve_sys_error(svinst,
+				"failed to open script %s "
+				"(view user logfile %s for more information)",
+				script_path, srctx->userlog);
 		} else {
-			if ( script_path == srctx->user_script && srctx->userlog != NULL ) {
-				sieve_sys_error(svinst,
-					"failed to open script %s "
-					"(view user logfile %s for more information)",
-					script_path, srctx->userlog);
-			} else {
-				sieve_sys_error(svinst,
-					"failed to open script %s", script_path);
-			}
+			sieve_sys_error(svinst,
+				"failed to open script %s", script_path);
 		}
 
 		return NULL;
@@ -304,11 +303,12 @@
 		( script_path == srctx->main_script ? "main_script" : NULL );
 	struct sieve_error_handler *ehandler;
 	struct sieve_binary *sbin;
+	bool debug = srctx->mdctx->dest_user->mail_debug;
 
 	/* Warn */
 
-	sieve_sys_warning(svinst, "encountered corrupt binary: re-compiling script %s",
-		script_path);
+	sieve_sys_warning(svinst,
+		"encountered corrupt binary: re-compiling script %s", script_path);
 
 	/* Recompile */
 
@@ -320,7 +320,12 @@
 	if ( (sbin=sieve_compile
 		(svinst, script_path, script_name, ehandler, error_r)) == NULL ) {
 
-		if ( script_path == srctx->user_script && srctx->userlog != NULL ) {
+		if ( *error_r == SIEVE_ERROR_NOT_FOUND ) {
+			if ( debug )
+				sieve_sys_debug(svinst, "script file %s is missing for re-compile", 
+					script_path);
+		} else if ( *error_r == SIEVE_ERROR_NOT_VALID && 
+			script_path == srctx->user_script && srctx->userlog != NULL ) {
 			sieve_sys_error(svinst,
 				"failed to re-compile script %s "
 				"(view user logfile %s for more information)",


More information about the dovecot-cvs mailing list