dovecot-2.0: doveadm move: Use UTF-8 for destination mailbox name.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 25 22:49:48 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/447d20eae931
changeset: 12937:447d20eae931
user:      Pascal Volk <user at localhost.localdomain.org>
date:      Sun Sep 25 19:52:43 2011 +0000
description:
doveadm move: Use UTF-8 for destination mailbox name.

diffstat:

 src/doveadm/doveadm-mail-move.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r dc9028da338b -r 447d20eae931 src/doveadm/doveadm-mail-move.c
--- a/src/doveadm/doveadm-mail-move.c	Thu Sep 22 13:09:18 2011 +0300
+++ b/src/doveadm/doveadm-mail-move.c	Sun Sep 25 19:52:43 2011 +0000
@@ -1,6 +1,8 @@
 /* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "str.h"
+#include "imap-utf7.h"
 #include "mail-storage.h"
 #include "mail-namespace.h"
 #include "doveadm-print.h"
@@ -112,10 +114,16 @@
 {
 	struct move_cmd_context *ctx = (struct move_cmd_context *)_ctx;
 	const char *destname = args[0];
+	string_t *str;
 
 	if (destname == NULL || args[1] == NULL)
 		doveadm_mail_help_name("move");
 
+	str = t_str_new(128);
+	if (imap_utf8_to_utf7(destname, str) < 0)
+		i_fatal("Mailbox name not valid UTF-8: %s", destname);
+	destname = str_c(str);
+
 	ctx->destname = p_strdup(ctx->ctx.pool, destname);
 	ctx->ctx.search_args = doveadm_mail_build_search_args(args + 1);
 	expunge_search_args_check(ctx->ctx.search_args, "move");


More information about the dovecot-cvs mailing list