]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: GETMETADATA was returning mailbox name as UTF-8 instead of mUTF-7
authorTimo Sirainen <tss@iki.fi>
Fri, 3 Oct 2014 14:11:58 +0000 (17:11 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 3 Oct 2014 14:11:58 +0000 (17:11 +0300)
src/imap/cmd-getmetadata.c

index ea94c197af550fd63849659ac57925aad47830b4..371a939859e8e3791f8858094ced1ed9137beea5 100644 (file)
@@ -5,6 +5,7 @@
 #include "istream.h"
 #include "ostream.h"
 #include "mailbox-list-iter.h"
+#include "imap-utf7.h"
 #include "imap-quote.h"
 #include "imap-metadata.h"
 
@@ -105,9 +106,13 @@ metadata_add_entry(struct imap_getmetadata_context *ctx, const char *entry)
 
        str = t_str_new(64);
        if (!ctx->first_entry_sent) {
+               string_t *mailbox_mutf7 = t_str_new(64);
+
                ctx->first_entry_sent = TRUE;
                str_append(str, "* METADATA ");
-               imap_append_astring(str, mailbox_get_vname(ctx->box));
+               if (imap_utf8_to_utf7(mailbox_get_vname(ctx->box), mailbox_mutf7) < 0)
+                       i_unreached();
+               imap_append_astring(str, str_c(mailbox_mutf7));
                str_append(str, " (");
 
                /* nothing can be sent until untagged METADATA is finished */