]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Fixed ns=prefix to work for private namespaces.
authorTimo Sirainen <tss@iki.fi>
Tue, 3 Aug 2010 12:10:19 +0000 (13:10 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 3 Aug 2010 12:10:19 +0000 (13:10 +0100)
src/plugins/quota/quota-storage.c

index a3eb7ee2e5afabde9c005ed2ad1cce909ddc3b67..4f3cc7b40d952d4a97a010ce0e819e3fa2b1447a 100644 (file)
@@ -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;
        }