From: Timo Sirainen Date: Mon, 23 Apr 2012 10:19:44 +0000 (+0300) Subject: quota: Recalculation now also counts the namespace prefix mailbox's quota if it exists. X-Git-Tag: 2.1.5~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87b71ffbf111ce67a8392c8d4ef0055f208cc88a;p=thirdparty%2Fdovecot%2Fcore.git quota: Recalculation now also counts the namespace prefix mailbox's quota if it exists. --- diff --git a/src/plugins/quota/quota-count.c b/src/plugins/quota/quota-count.c index d693f90fc1..e1ede1f517 100644 --- a/src/plugins/quota/quota-count.c +++ b/src/plugins/quota/quota-count.c @@ -83,7 +83,12 @@ quota_count_namespace(struct quota_root *root, struct mail_namespace *ns, } if (mailbox_list_iter_deinit(&ctx) < 0) ret = -1; - + if (ns->prefix_len > 0 && ret == 0 && + (ns->prefix_len != 6 || strncasecmp(ns->prefix, "INBOX", 5) != 0)) { + /* if the namespace prefix itself exists, count it also */ + const char *name = t_strndup(ns->prefix, ns->prefix_len-1); + ret = quota_count_mailbox(root, ns, name, bytes, count); + } return ret; }