dovecot-2.0: quota: With mail_debug=yes, show the non-default ru...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 30 22:42:21 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/b09638ebb87d
changeset: 11663:b09638ebb87d
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 30 20:42:13 2010 +0100
description:
quota: With mail_debug=yes, show the non-default rule bytes/messages with "+" prefix.

diffstat:

 src/plugins/quota/quota.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r 8468998b98ab -r b09638ebb87d src/plugins/quota/quota.c
--- 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));


More information about the dovecot-cvs mailing list