dovecot-1.2: quota: Fixed ns=prefix to work for private namespaces.

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 3 15:11:49 EEST 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/e5f3bd280210
changeset: 9596:e5f3bd280210
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 03 13:11:47 2010 +0100
description:
quota: Fixed ns=prefix to work for private namespaces.

diffstat:

 src/plugins/quota/quota-storage.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r 166a188f9165 -r e5f3bd280210 src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Fri Jul 30 16:55:58 2010 +0100
+++ b/src/plugins/quota/quota-storage.c	Tue Aug 03 13:11:47 2010 +0100
@@ -557,16 +557,18 @@
 	struct quota_root *root;
 	bool add;
 
+	/* see if we have a quota explicitly defined for this namespace */
+	quota = quota_get_mail_user_quota(list->ns->user);
+	root = quota_find_root_for_ns(quota, list->ns);
+	if (root != NULL)
+		root->ns = list->ns;
+
 	if ((list->ns->flags & NAMESPACE_FLAG_NOQUOTA) != 0)
 		add = FALSE;
 	else if (list->ns->owner == NULL) {
-		/* see if we have a quota explicitly defined for
-		   this namespace */
-		quota = quota_get_mail_user_quota(list->ns->user);
-		root = quota_find_root_for_ns(quota, list->ns);
+		/* public namespace - add quota only if namespace is
+		   explicitly defined for it */
 		add = root != NULL;
-		if (root != NULL)
-			root->ns = list->ns;
 	} else {
 		add = TRUE;
 	}


More information about the dovecot-cvs mailing list