quota-count.c revision 8eb223b84389a7b75a39d46484f5166d221305eb
/* Copyright (c) 2006-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-search-build.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include "quota-private.h"
static int
{
struct quota_rule *rule;
struct mailbox_transaction_context *trans;
struct mail_search_context *ctx;
struct mail_search_args *search_args;
const char *storage_name;
enum mail_error error;
int ret = 0;
/* mailbox not included in quota */
return 0;
}
mailbox_free(&box);
if (error == MAIL_ERROR_TEMP)
return -1;
/* non-temporary error, e.g. ACLs denied access. */
return 0;
}
*count_r += 1;
}
if (mailbox_search_deinit(&ctx) < 0)
ret = -1;
if (ret < 0)
else
(void)mailbox_transaction_commit(&trans);
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)
ret = -1;
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;
}