From dadedf97ee3352256a79bf4c4e1d5f5048d3fd65 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Fri, 2 Mar 2018 00:14:55 +0100
Subject: [PATCH] lib-sieve: store action: Sanitize both specified and virtual
 mailbox names in log strings.

Before, the virtual mailbox name was not sanitized, which caused control
characters to be displayed in log messages. Also, the mailbox name would be
mentioned twice in the log message, once santized and once unsanitized.
---
 src/lib-sieve/sieve-actions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib-sieve/sieve-actions.c b/src/lib-sieve/sieve-actions.c
index f05707b4d..38924495e 100644
--- a/src/lib-sieve/sieve-actions.c
+++ b/src/lib-sieve/sieve-actions.c
@@ -607,7 +607,7 @@ static void act_store_log_status
 	mailbox_name = str_sanitize(trans->context->mailbox, 128);
 
 	if ( trans->box != NULL ) {
-		const char *mailbox_vname = mailbox_get_vname(trans->box);
+		const char *mailbox_vname = str_sanitize(mailbox_get_vname(trans->box), 128);
 
 		if ( strcmp(mailbox_name, mailbox_vname) != 0 )
 			mailbox_name =
-- 
GitLab