dovecot-2.0-pigeonhole: Made sure that store action logs both UT...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon Aug 30 11:14:01 EEST 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/dbe440b85c1b
changeset: 1402:dbe440b85c1b
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Aug 30 10:13:54 2010 +0200
description:
Made sure that store action logs both UTF-8 and mUTF-7 names when applicable.

diffstat:

 src/lib-sieve/sieve-actions.c |  27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diffs (57 lines):

diff -r 668a375ac336 -r dbe440b85c1b src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c	Mon Aug 30 09:20:44 2010 +0200
+++ b/src/lib-sieve/sieve-actions.c	Mon Aug 30 10:13:54 2010 +0200
@@ -536,18 +536,27 @@
 {
 	const char *mailbox_name;
 
-	if ( trans->box != NULL )
-		mailbox_name = str_sanitize(mailbox_get_vname(trans->box), 128);
-	else
-		mailbox_name = str_sanitize(trans->context->mailbox, 128);
+	mailbox_name = str_sanitize(trans->context->mailbox, 128);
+
+	if ( trans->box != NULL ) {
+		const char *mailbox_vname = mailbox_get_vname(trans->box);
+
+		if ( strcmp(mailbox_name, mailbox_vname) != 0 )
+			mailbox_name = 
+				t_strdup_printf("'%s' (%s)", mailbox_name, mailbox_vname);
+		else 
+			mailbox_name = t_strdup_printf("'%s'", mailbox_name);
+	} else {
+		mailbox_name = t_strdup_printf("'%s'", mailbox_name);
+	}
 
 	/* Store disabled? */
 	if ( trans->disabled ) {
-		sieve_result_log(aenv, "store into mailbox '%s' skipped", mailbox_name);
+		sieve_result_log(aenv, "store into mailbox %s skipped", mailbox_name);
 	
 	/* Store redundant? */
 	} else if ( trans->redundant ) {
-		sieve_result_log(aenv, "left message in mailbox '%s'", mailbox_name);
+		sieve_result_log(aenv, "left message in mailbox %s", mailbox_name);
 
 	/* Store failed? */
 	} else if ( !status ) {
@@ -560,16 +569,16 @@
 			errstr = mail_storage_get_last_error
 				(mailbox_get_storage(trans->box), &error);
 	
-		sieve_result_error(aenv, "failed to store into mailbox '%s': %s", 
+		sieve_result_error(aenv, "failed to store into mailbox %s: %s", 
 			mailbox_name, errstr);
 
 	/* Store aborted? */
 	} else if ( rolled_back ) {
-		sieve_result_log(aenv, "store into mailbox '%s' aborted", mailbox_name);
+		sieve_result_log(aenv, "store into mailbox %s aborted", mailbox_name);
 
 	/* Succeeded */
 	} else {
-		sieve_result_log(aenv, "stored mail into mailbox '%s'", mailbox_name);
+		sieve_result_log(aenv, "stored mail into mailbox %s", mailbox_name);
 
 	}
 }


More information about the dovecot-cvs mailing list