From: Timo Sirainen Date: Tue, 3 Aug 2010 12:10:19 +0000 (+0100) Subject: quota: Fixed ns=prefix to work for private namespaces. X-Git-Tag: 2.0.rc4~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=805872b9f885c1cc4bddf0b6ff71ca61f6cdd7bf;p=thirdparty%2Fdovecot%2Fcore.git quota: Fixed ns=prefix to work for private namespaces. --- diff --git a/src/plugins/quota/quota-storage.c b/src/plugins/quota/quota-storage.c index a3eb7ee2e5..4f3cc7b40d 100644 --- a/src/plugins/quota/quota-storage.c +++ b/src/plugins/quota/quota-storage.c @@ -477,16 +477,18 @@ void quota_mail_namespace_storage_added(struct mail_namespace *ns) struct quota_root *root; bool add; + /* see if we have a quota explicitly defined for this namespace */ + quota = quota_get_mail_user_quota(ns->user); + root = quota_find_root_for_ns(quota, ns); + if (root != NULL) + root->ns = ns; + if ((ns->flags & NAMESPACE_FLAG_NOQUOTA) != 0) add = FALSE; else if (ns->owner == NULL) { - /* see if we have a quota explicitly defined for - this namespace */ - quota = quota_get_mail_user_quota(ns->user); - root = quota_find_root_for_ns(quota, ns); + /* public namespace - add quota only if namespace is + explicitly defined for it */ add = root != NULL; - if (root != NULL) - root->ns = ns; } else { add = TRUE; }