dovecot-2.2: quota: Fixed "count" backend to ignore storages tha...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 28 13:21:28 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/2db9595b302e
changeset: 19249:2db9595b302e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 28 16:20:02 2015 +0300
description:
quota: Fixed "count" backend to ignore storages that have quota disabled.
For example virtual mailboxes shouldn't be counted in quota.

diffstat:

 src/plugins/quota/quota-count.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (20 lines):

diff -r 08725018dedd -r 2db9595b302e src/plugins/quota/quota-count.c
--- a/src/plugins/quota/quota-count.c	Mon Sep 28 16:17:13 2015 +0300
+++ b/src/plugins/quota/quota-count.c	Mon Sep 28 16:20:02 2015 +0300
@@ -34,10 +34,12 @@
 	}
 
 	box = mailbox_alloc(ns->list, vname, MAILBOX_FLAG_READONLY);
-	if (mailbox_get_metadata(box, root->quota->set->vsizes ?
-				 MAILBOX_METADATA_VIRTUAL_SIZE :
-				 MAILBOX_METADATA_PHYSICAL_SIZE,
-				 &metadata) < 0 ||
+	if ((box->storage->class_flags & MAIL_STORAGE_CLASS_FLAG_NOQUOTA) != 0) {
+		/* quota doesn't exist for this mailbox/storage */
+	} else if (mailbox_get_metadata(box, root->quota->set->vsizes ?
+					MAILBOX_METADATA_VIRTUAL_SIZE :
+					MAILBOX_METADATA_PHYSICAL_SIZE,
+					&metadata) < 0 ||
 	    mailbox_get_status(box, STATUS_MESSAGES, &status) < 0) {
 		errstr = mailbox_get_last_error(box, &error);
 		if (error == MAIL_ERROR_TEMP) {


More information about the dovecot-cvs mailing list