]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Fix remote/storage mailbox name mismatches
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 16 Jan 2021 13:03:59 +0000 (15:03 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 3 Feb 2021 09:04:22 +0000 (09:04 +0000)
src/lib-storage/index/imapc/imapc-storage.c

index 25d0f3870f6941591c74671dc2889e97325cd350..e06440f1182134e7f9cfb7b10ee5df5e9c761b2d 100644 (file)
@@ -883,7 +883,10 @@ static void imapc_untagged_status(const struct imapc_untagged_reply *reply,
 
        if (storage->cur_status_box == NULL)
                return;
-       if (strcmp(storage->cur_status_box->box.name, remote_name) == 0) {
+
+       const char *cur_status_remote_name =
+               imapc_mailbox_get_remote_name(storage->cur_status_box);
+       if (strcmp(cur_status_remote_name, remote_name) == 0) {
                /* match */
        } else if (strcasecmp(storage->cur_status_box->box.name, "INBOX") == 0 &&
                   strcasecmp(remote_name, "INBOX") == 0) {
@@ -1125,7 +1128,8 @@ static int imapc_mailbox_get_metadata(struct mailbox *box,
                if (imapc_mailbox_get_namespaces(mbox) < 0)
                        return -1;
 
-               ns = imapc_namespace_find_mailbox(mbox->storage, box->name);
+               const char *remote_name = imapc_mailbox_get_remote_name(mbox);
+               ns = imapc_namespace_find_mailbox(mbox->storage, remote_name);
                if (ns != NULL) {
                        metadata_r->backend_ns_prefix = ns->prefix;
                        metadata_r->backend_ns_type = ns->type;