From: Timo Sirainen Date: Fri, 31 May 2013 14:36:19 +0000 (+0300) Subject: imapc: Empty imapc_user expands to namespace's owner, or with public namespaces to... X-Git-Tag: 2.2.3~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bf0c44fce1df29e60f4f5b312ebe862d44aa237;p=thirdparty%2Fdovecot%2Fcore.git imapc: Empty imapc_user expands to namespace's owner, or with public namespaces to user itself. The main idea is that with shared namespaces it now expands to the shared username, allowing shared mailbox access via imapc. --- diff --git a/src/lib-storage/index/imapc/imapc-storage.c b/src/lib-storage/index/imapc/imapc-storage.c index 4a3e03410a..24a0972094 100644 --- a/src/lib-storage/index/imapc/imapc-storage.c +++ b/src/lib-storage/index/imapc/imapc-storage.c @@ -230,7 +230,12 @@ imapc_storage_create(struct mail_storage *_storage, return -1; } set.port = storage->set->imapc_port; - set.username = storage->set->imapc_user; + if (storage->set->imapc_user[0] != '\0') + set.username = storage->set->imapc_user; + else if (ns->owner != NULL) + set.username = ns->owner->username; + else + set.username = ns->user->username; set.master_user = storage->set->imapc_master_user; set.password = storage->set->imapc_password; if (*set.password == '\0') {