dovecot-2.0: lib-storage: Fixed autocreating namespaces for shar...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Apr 16 17:23:55 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/960c6936ba6a
changeset: 11166:960c6936ba6a
user: Timo Sirainen <tss at iki.fi>
date: Fri Apr 16 17:23:43 2010 +0300
description:
lib-storage: Fixed autocreating namespaces for shared users in some situations.
diffstat:
src/lib-storage/mail-namespace.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diffs (36 lines):
diff -r 8d45d4884019 -r 960c6936ba6a src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c Fri Apr 16 17:23:24 2010 +0300
+++ b/src/lib-storage/mail-namespace.c Fri Apr 16 17:23:43 2010 +0300
@@ -545,10 +545,31 @@
return best;
}
+static struct mail_namespace *
+mail_namespace_find_shared(struct mail_namespace *ns, const char **mailbox)
+{
+ struct mailbox_list *list = ns->list;
+ struct mail_storage *storage;
+
+ if (mailbox_list_get_storage(&list, mailbox, &storage) < 0)
+ return ns;
+
+ return mailbox_list_get_namespace(list);
+}
+
struct mail_namespace *
mail_namespace_find(struct mail_namespace *namespaces, const char **mailbox)
{
- return mail_namespace_find_mask(namespaces, mailbox, 0, 0);
+ struct mail_namespace *ns;
+
+ ns = mail_namespace_find_mask(namespaces, mailbox, 0, 0);
+ if (ns != NULL && ns->type == NAMESPACE_SHARED &&
+ (ns->flags & NAMESPACE_FLAG_AUTOCREATED) == 0) {
+ /* see if we need to autocreate a namespace for shared user */
+ if (strchr(*mailbox, ns->sep) != NULL)
+ return mail_namespace_find_shared(ns, mailbox);
+ }
+ return ns;
}
struct mail_namespace *
More information about the dovecot-cvs
mailing list