changeset 8469:e2ec45b71119 HEAD

dict quota: Don't fail quota calculation if some mailboxes aren't accessible.
author Timo Sirainen <tss@iki.fi>
date Fri, 21 Nov 2008 19:45:22 +0200
parents d4eab639c253
children e4f319453cb2
files src/plugins/quota/quota-count.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota-count.c	Fri Nov 21 19:24:04 2008 +0200
+++ b/src/plugins/quota/quota-count.c	Fri Nov 21 19:45:22 2008 +0200
@@ -16,6 +16,7 @@
 	struct mail_search_context *ctx;
 	struct mail *mail;
 	struct mail_search_args *search_args;
+	enum mail_error error;
 	uoff_t size;
 	int ret = 0;
 
@@ -27,8 +28,13 @@
 
 	box = mailbox_open(&storage, name, NULL,
 			   MAILBOX_OPEN_READONLY | MAILBOX_OPEN_KEEP_RECENT);
-	if (box == NULL)
-		return -1;
+	if (box == NULL) {
+		mail_storage_get_last_error(storage, &error);
+		if (error == MAIL_ERROR_TEMP)
+			return -1;
+		/* non-temporary error, e.g. ACLs denied access. */
+		return 0;
+	}
 
 	if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ, 0, NULL) < 0) {
 		mailbox_close(&box);