dovecot-1.2: lib-lda: Log mailbox name using UTF-8, not mUTF-7.

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 10 04:04:51 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/2a6e47b50ee5
changeset: 9469:2a6e47b50ee5
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 09 21:04:45 2009 -0500
description:
lib-lda: Log mailbox name using UTF-8, not mUTF-7.

diffstat:

1 file changed, 12 insertions(+), 1 deletion(-)
src/deliver/deliver.c |   13 ++++++++++++-

diffs (30 lines):

diff -r 7ea4e58aa356 -r 2a6e47b50ee5 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Mon Nov 09 20:52:54 2009 -0500
+++ b/src/deliver/deliver.c	Mon Nov 09 21:04:45 2009 -0500
@@ -205,6 +205,17 @@ mailbox_open_or_create_synced(struct mai
 	return box;
 }
 
+static const char *mailbox_name_get_printable(const char *mailbox_mutf7)
+{
+	string_t *str = t_str_new(128);
+
+	if (imap_utf7_to_utf8(mailbox_mutf7, str) < 0) {
+		str_truncate(str, 0);
+		str_append(str, mailbox_mutf7);
+	}
+	return str_sanitize(str_c(str), 80);
+}
+
 int deliver_save(struct mail_namespace *namespaces,
 		 struct mail_storage **storage_r, const char *mailbox,
 		 struct mail *mail, enum mail_flags flags,
@@ -223,7 +234,7 @@ int deliver_save(struct mail_namespace *
 	if (default_save)
 		tried_default_save = TRUE;
 
-	mailbox_name = str_sanitize(mailbox, 80);
+	mailbox_name = mailbox_name_get_printable(mailbox);
 	box = mailbox_open_or_create_synced(namespaces, storage_r, mailbox);
 	if (box == NULL) {
 		if (*storage_r == NULL) {


More information about the dovecot-cvs mailing list