dovecot-2.1: imap: Mailbox names in STATUS replies were sent as ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 2 14:54:47 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/a698fccd37c3
changeset: 14589:a698fccd37c3
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jul 02 14:54:33 2012 +0300
description:
imap: Mailbox names in STATUS replies were sent as UTF-8 instead of mUTF-7.

diffstat:

 src/imap/cmd-list.c    |  10 ++++++----
 src/imap/cmd-status.c  |   5 +++--
 src/imap/imap-status.c |   4 ++--
 src/imap/imap-status.h |   2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

diffs (96 lines):

diff -r 569588ff7ef0 -r a698fccd37c3 src/imap/cmd-list.c
--- a/src/imap/cmd-list.c	Mon Jul 02 10:12:59 2012 +0300
+++ b/src/imap/cmd-list.c	Mon Jul 02 14:54:33 2012 +0300
@@ -364,8 +364,9 @@
 	client_send_line(ctx->cmd->client, str_c(str));
 }
 
-static void list_send_status(struct cmd_list_context *ctx, const char *name,
-			     enum mailbox_info_flags flags)
+static void
+list_send_status(struct cmd_list_context *ctx, const char *name,
+		 const char *mutf7_name, enum mailbox_info_flags flags)
 {
 	struct imap_status_result result;
 	struct mail_namespace *ns;
@@ -391,7 +392,8 @@
 		return;
 	}
 
-	imap_status_send(ctx->cmd->client, name, &ctx->status_items, &result);
+	imap_status_send(ctx->cmd->client, mutf7_name,
+			 &ctx->status_items, &result);
 }
 
 static bool list_has_empty_prefix_ns(struct mail_user *user)
@@ -481,7 +483,7 @@
 
 		ret = client_send_line(ctx->cmd->client, str_c(str));
 		if (ctx->used_status) T_BEGIN {
-			list_send_status(ctx, name, flags);
+			list_send_status(ctx, name, str_c(mutf7_name), flags);
 		} T_END;
 		if (ret == 0) {
 			/* buffer is full, continue later */
diff -r 569588ff7ef0 -r a698fccd37c3 src/imap/cmd-status.c
--- a/src/imap/cmd-status.c	Mon Jul 02 10:12:59 2012 +0300
+++ b/src/imap/cmd-status.c	Mon Jul 02 14:54:33 2012 +0300
@@ -13,7 +13,7 @@
 	struct imap_status_items items;
 	struct imap_status_result result;
 	struct mail_namespace *ns;
-	const char *mailbox, *error;
+	const char *mailbox, *orig_mailbox, *error;
 	bool selected_mailbox;
 
 	/* <mailbox> <status items> */
@@ -30,6 +30,7 @@
 	if (imap_status_parse_items(cmd, list_args, &items) < 0)
 		return TRUE;
 
+	orig_mailbox = mailbox;
 	ns = client_find_namespace(cmd, &mailbox);
 	if (ns == NULL)
 		return TRUE;
@@ -42,7 +43,7 @@
 		return TRUE;
 	}
 
-	imap_status_send(client, mailbox, &items, &result);
+	imap_status_send(client, orig_mailbox, &items, &result);
 	if (!selected_mailbox)
 		client_send_tagline(cmd, "OK Status completed.");
 	else {
diff -r 569588ff7ef0 -r a698fccd37c3 src/imap/imap-status.c
--- a/src/imap/imap-status.c	Mon Jul 02 10:12:59 2012 +0300
+++ b/src/imap/imap-status.c	Mon Jul 02 14:54:33 2012 +0300
@@ -96,7 +96,7 @@
 	return ret;
 }
 
-void imap_status_send(struct client *client, const char *mailbox,
+void imap_status_send(struct client *client, const char *mailbox_mutf7,
 		      const struct imap_status_items *items,
 		      const struct imap_status_result *result)
 {
@@ -106,7 +106,7 @@
 
 	str = t_str_new(128);
 	str_append(str, "* STATUS ");
-        imap_quote_append_string(str, mailbox, FALSE);
+        imap_quote_append_string(str, mailbox_mutf7, FALSE);
 	str_append(str, " (");
 
 	prefix_len = str_len(str);
diff -r 569588ff7ef0 -r a698fccd37c3 src/imap/imap-status.h
--- a/src/imap/imap-status.h	Mon Jul 02 10:12:59 2012 +0300
+++ b/src/imap/imap-status.h	Mon Jul 02 14:54:33 2012 +0300
@@ -18,7 +18,7 @@
 		    struct mail_namespace *ns,
 		    const char *mailbox, const struct imap_status_items *items,
 		    struct imap_status_result *result_r, const char **error_r);
-void imap_status_send(struct client *client, const char *mailbox,
+void imap_status_send(struct client *client, const char *mailbox_mutf7,
 		      const struct imap_status_items *items,
 		      const struct imap_status_result *result);
 


More information about the dovecot-cvs mailing list