dovecot-2.1: dsync: Fixed handling non-ASCII characters in mailb...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 28 22:40:09 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/ef6f3b7f6038
changeset: 14026:ef6f3b7f6038
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jan 28 22:39:58 2012 +0200
description:
dsync: Fixed handling non-ASCII characters in mailbox names.

diffstat:

 src/doveadm/dsync/dsync-worker-local.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 41cb0217b7c3 -r ef6f3b7f6038 src/doveadm/dsync/dsync-worker-local.c
--- a/src/doveadm/dsync/dsync-worker-local.c	Sat Jan 28 22:24:26 2012 +0200
+++ b/src/doveadm/dsync/dsync-worker-local.c	Sat Jan 28 22:39:58 2012 +0200
@@ -1052,10 +1052,11 @@
 
 static const char *
 local_worker_convert_mailbox_name(struct local_dsync_worker *worker,
-				  const char *name, struct mail_namespace *ns,
+				  const char *vname, struct mail_namespace *ns,
 				  const struct dsync_mailbox *dsync_box,
 				  bool creating)
 {
+	const char *name = vname;
 	char list_sep, ns_sep = mail_namespace_get_sep(ns);
 
 	if (dsync_box->name_sep != ns_sep) {
@@ -1063,6 +1064,8 @@
 		name = mailbox_name_convert(worker, name,
 					    dsync_box->name_sep, ns_sep);
 	}
+	name = mailbox_list_get_storage_name(ns->list, name);
+
 	if (creating) {
 		list_sep = mailbox_list_get_hierarchy_sep(ns->list);
 		if (!mailbox_list_is_valid_create_name(ns->list, name)) {
@@ -1091,7 +1094,7 @@
 		}
 		i_assert(mailbox_list_is_valid_create_name(ns->list, name));
 	}
-	return name;
+	return mailbox_list_get_vname(ns->list, name);
 }
 
 static struct mailbox *
@@ -1185,7 +1188,7 @@
 
 	local_dsync_worker_add_mailbox(worker,
 				       mailbox_get_namespace(box),
-				       mailbox_get_name(box),
+				       mailbox_get_vname(box),
 				       &dsync_box->mailbox_guid);
 	return 1;
 }
@@ -1215,7 +1218,7 @@
 
 	/* mailbox name already exists. add mailbox guid to the name,
 	   that shouldn't exist. */
-	new_name = t_strconcat(mailbox_get_name(box), "_",
+	new_name = t_strconcat(mailbox_get_vname(box), "_",
 			       dsync_guid_to_str(&dsync_box->mailbox_guid),
 			       NULL);
 	ns = mailbox_get_namespace(box);


More information about the dovecot-cvs mailing list