changeset 11663:b09638ebb87d HEAD

quota: With mail_debug=yes, show the non-default rule bytes/messages with "+" prefix.
author Timo Sirainen <tss@iki.fi>
date Wed, 30 Jun 2010 20:42:13 +0100
parents 8468998b98ab
children 372af44dca85
files src/plugins/quota/quota.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota.c	Wed Jun 30 20:35:09 2010 +0100
+++ b/src/plugins/quota/quota.c	Wed Jun 30 20:42:13 2010 +0100
@@ -511,11 +511,17 @@
 					      root_set->default_rule.bytes_limit,
 					      root_set->default_rule.count_limit);
 	if (root_set->set->debug) {
+		const char *rule_plus =
+			rule == &root_set->default_rule ? "" : "+";
+
 		i_debug("Quota rule: root=%s mailbox=%s "
-			"bytes=%lld%s messages=%lld%s", root_set->name,
-			mailbox_name, (long long)rule->bytes_limit,
+			"bytes=%s%lld%s messages=%s%lld%s",
+			root_set->name, mailbox_name,
+			rule->bytes_limit > 0 ? rule_plus : "",
+			(long long)rule->bytes_limit,
 			rule->bytes_percent == 0 ? "" :
 			t_strdup_printf(" (%u%%)", rule->bytes_percent),
+			rule->count_limit > 0 ? rule_plus : "",
 			(long long)rule->count_limit,
 			rule->count_percent == 0 ? "" :
 			t_strdup_printf(" (%u%%)", rule->count_percent));