imap-quota-plugin.c revision f4e66312c54f8f21df984e3b17c0cc752e019ec5
/* Copyright (c) 2005-2017 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "str.h"
#include "ostream.h"
#include "imap-quote.h"
#include "mail-namespace.h"
#include "imap-commands.h"
#include "quota.h"
#include "quota-plugin.h"
#include "imap-quota-plugin.h"
#define QUOTA_USER_SEPARATOR ':'
const char *imap_quota_plugin_version = DOVECOT_ABI_VERSION;
static struct module *imap_quota_module;
static const char *
struct quota_root *root)
{
const char *name;
return name;
}
static int
{
unsigned int i;
int ret = 0;
if (ret < 0)
break;
if (ret > 0) {
if (i > 0)
(unsigned long long)value,
(unsigned long long)limit);
i++;
}
}
/* this quota root doesn't have any quota actually enabled. */
return ret;
}
return 1;
}
{
struct mail_namespace *ns;
struct quota_root_iter *iter;
struct quota_root *root;
int ret;
/* <mailbox> */
return FALSE;
return TRUE;
return TRUE;
}
return TRUE;
}
/* build QUOTAROOT reply and QUOTA reply for all quota roots */
ret = 0;
if (quota_root_is_hidden(root))
continue;
ret = -1;
}
mailbox_free(&box);
/* send replies */
if (ret < 0)
else if (str_len(quota_reply) == 0)
else {
}
return TRUE;
}
static bool
{
const char *p;
/* we're an admin. see if there's a quota root for another user. */
if (p != NULL) {
}
}
{
struct quota_root *root;
const char *root_name;
/* <quota root> */
return FALSE;
return TRUE;
}
else {
}
return TRUE;
}
{
struct quota_root *root;
/* <quota root> <resource limits> */
return FALSE;
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
}
return TRUE;
}
{
if (next_hook_client_created != NULL)
}
{
}
void imap_quota_plugin_deinit(void)
{
command_unregister("GETQUOTAROOT");
command_unregister("GETQUOTA");
command_unregister("SETQUOTA");
}
const char imap_quota_plugin_binary_dependency[] = "imap";