quota-count.c revision c16bf6335c393c00465903f7a46ce2b7ceb6726e
/* Copyright (c) 2006-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "mailbox-list-iter.h"
#include "quota-private.h"
extern struct quota_backend quota_backend_count;
static int
{
struct quota_rule *rule;
struct mailbox_metadata metadata;
struct mailbox_status status;
enum mail_error error;
const char *errstr;
int ret;
/* mailbox not included in quota */
return 0;
}
&metadata) < 0 ||
if (error == MAIL_ERROR_TEMP) {
i_error("quota: Couldn't get physical size of mailbox %s: %s",
ret = -1;
} else {
/* non-temporary error, e.g. ACLs denied access. */
ret = 0;
}
} else {
ret = 1;
}
mailbox_free(&box);
return ret;
}
static int
{
struct mailbox_list_iterate_context *ctx;
const struct mailbox_info *info;
int ret = 0;
MAILBOX_NOSELECT)) == 0) {
if (ret < 0)
break;
}
}
if (mailbox_list_iter_deinit(&ctx) < 0) {
i_error("quota: Listing namespace '%s' failed: %s",
ret = -1;
}
/* if the namespace prefix itself exists, count it also */
}
return ret;
}
{
struct mail_namespace *const *namespaces;
unsigned int i, count;
int ret = 0;
if (root->recounting)
return 0;
for (i = 0; i < count; i++) {
continue;
if (ret < 0)
break;
}
return ret;
}