mail-namespace.c revision 5b560a354d9ce6d38134717af6554dae269d860f
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen/* Copyright (c) 2005-2012 Dovecot authors, see the included COPYING file */
e65cc79f80577e83c706f0678c78e2c0bd91434fTimo Sirainenvoid mail_namespace_add_storage(struct mail_namespace *ns,
25ee72451d16374ed27fdbf829f4ec756c778352Timo Sirainen /* currently we support only a single storage */
10c5fd417af4ee30b68c967f5e7d5a49f4f149b5Timo Sirainenvoid mail_namespace_finish_list_init(struct mail_namespace *ns,
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainenstatic void mail_namespace_free(struct mail_namespace *ns)
c4457e497e01b57565d24da624968699b166e02aTimo Sirainen if (ns->owner != ns->user && ns->owner != NULL)
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen struct mail_namespace_settings *unexpanded_ns_set,
0d7d27765267594a5870892268ab345148306d49Timo Sirainen struct mail_namespace **ns_p, const char **error_r)
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen if (strncmp(ns_set->type, "private", 7) == 0) {
ed5e91e58dfc372c2135c55427bf6f25a7725042Timo Sirainen } else if (strncmp(ns_set->type, "shared", 6) == 0)
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen else if (strncmp(ns_set->type, "public", 6) == 0)
25ee72451d16374ed27fdbf829f4ec756c778352Timo Sirainen *error_r = t_strdup_printf("Unknown namespace type: %s",
d1f0acc7fc722e13e8296228703adfe8a884d59eTimo Sirainen *error_r = t_strdup_printf("Invalid list setting value: %s",
const char **error_r)
return FALSE;
return FALSE;
return TRUE;
const char **error_r)
unsigned int subscriptions_count = 0;
return FALSE;
return FALSE;
return FALSE;
NAMESPACE_FLAG_LIST_CHILDREN)) != 0 &&
return FALSE;
NAMESPACE_FLAG_LIST_CHILDREN)) != 0 &&
return FALSE;
NAMESPACE_FLAG_LIST_CHILDREN)) != 0) {
return FALSE;
return FALSE;
return FALSE;
if (!visible_namespaces) {
return FALSE;
if (subscriptions_count == 0) {
return FALSE;
return TRUE;
count = 0;
for (i = 0; i < count; i++) {
T_BEGIN {
} T_END;
const char **error_r)
if (default_location) {
T_BEGIN {
} T_END;
return ns;
void *context)
struct mail_storage *
return TRUE;
return TRUE;
return TRUE;
return FALSE;
static struct mail_namespace *
unsigned int best_len = 0;
bool inbox;
return ns;
return best;
return best;
static struct mail_namespace *
return ns;
struct mail_namespace *
return ns;
struct mail_namespace *
const char **mailbox)
const char *storage_name;
return ns;
struct mail_namespace *
const char *mailbox)
struct mail_namespace *
const char *mailbox)
struct mail_namespace *
const char *mailbox)
struct mail_namespace *
return namespaces;
struct mail_namespace *
const char *prefix)
return ns;
return NULL;
struct mail_namespace *
const char *prefix)
return ns;
return NULL;