dovecot: If quota limits weren't specified, they should have bee...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jan 20 08:49:41 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/097fe25ab218
changeset: 7172:097fe25ab218
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jan 20 08:49:36 2008 +0200
description:
If quota limits weren't specified, they should have been taken from
maildirsize file.

diffstat:

1 file changed, 10 insertions(+), 4 deletions(-)
src/plugins/quota/quota-maildir.c |   14 ++++++++++----

diffs (32 lines):

diff -r 2e60288f0d75 -r 097fe25ab218 src/plugins/quota/quota-maildir.c
--- a/src/plugins/quota/quota-maildir.c	Sat Jan 19 09:14:50 2008 +0200
+++ b/src/plugins/quota/quota-maildir.c	Sun Jan 20 08:49:36 2008 +0200
@@ -677,18 +677,24 @@ maildir_quota_root_get_resources(struct 
 
 static int
 maildir_quota_get_resource(struct quota_root *_root, const char *name,
-			   uint64_t *value_r, uint64_t *limit  ATTR_UNUSED)
+			   uint64_t *value_r, uint64_t *limit_r)
 {
 	struct maildir_quota_root *root = (struct maildir_quota_root *)_root;
 
 	if (maildirquota_refresh(root) < 0)
 		return -1;
 
-	if (strcmp(name, QUOTA_NAME_STORAGE_BYTES) == 0)
+	if (strcmp(name, QUOTA_NAME_STORAGE_BYTES) == 0) {
 		*value_r = root->total_bytes;
-	else if (strcmp(name, QUOTA_NAME_MESSAGES) == 0)
+		if (!root->master_message_limits &&
+		    root->message_bytes_limit != (uint64_t)-1)
+			*limit_r = root->message_bytes_limit;
+	} else if (strcmp(name, QUOTA_NAME_MESSAGES) == 0) {
 		*value_r = root->total_count;
-	else
+		if (!root->master_message_limits &&
+		    root->message_count_limit != (uint64_t)-1)
+			*limit_r = root->message_count_limit;
+	} else
 		return 0;
 	return 1;
 }


More information about the dovecot-cvs mailing list