[dovecot-cvs] dovecot/src/plugins/quota quota-private.h, 1.15, 1.16 quota.c, 1.17, 1.18

tss at dovecot.org tss at dovecot.org
Thu Jan 25 15:49:51 UTC 2007


Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv16738

Modified Files:
	quota-private.h quota.c 
Log Message:
If mail_debug is enabled, log configured quota rules



Index: quota-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-private.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- quota-private.h	3 Dec 2006 18:55:38 -0000	1.15
+++ quota-private.h	25 Jan 2007 15:49:48 -0000	1.16
@@ -15,6 +15,7 @@
 	int (*test_alloc)(struct quota_transaction_context *ctx,
 			  uoff_t size, bool *too_large_r);
 
+	unsigned int debug:1;
 	unsigned int counting:1;
 };
 

Index: quota.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- quota.c	3 Dec 2006 18:55:38 -0000	1.17
+++ quota.c	25 Jan 2007 15:49:48 -0000	1.18
@@ -42,6 +42,7 @@
 
 	quota = i_new(struct quota, 1);
 	quota->test_alloc = quota_default_test_alloc;
+	quota->debug = getenv("DEBUG") != NULL;
 	i_array_init(&quota->roots, 4);
 	i_array_init(&quota->storages, 8);
 
@@ -203,6 +204,15 @@
 			break;
 		}
 	}
+
+	if (root->quota->debug) {
+		i_info("Quota rule: root=%s mailbox=%s "
+		       "storage=%lldkB messages=%lld", root->name,
+		       rule->mailbox_name != NULL ? rule->mailbox_name : "",
+		       (long long)rule->bytes_limit / 1024,
+		       (long long)rule->count_limit);
+	}
+
 	t_pop();
 	return ret;
 }



More information about the dovecot-cvs mailing list