mail-storage.c revision 74664ac6dcf88cfc2ae6378c87c20ba694385a23
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenextern struct mail_search_register *mail_search_register_imap;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenextern struct mail_search_register *mail_search_register_human;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct event_category event_category_storage = {
44ff75ca53188056ff5a3e50428e3f2078800b3cTimo Sirainenstruct event_category event_category_mailbox = {
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainenstruct mail_storage_module_register mail_storage_module_register = { 0 };
44ff75ca53188056ff5a3e50428e3f2078800b3cTimo Sirainenstruct mail_module_register mail_module_register = { 0 };
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct mail_storage_mail_index_module mail_storage_mail_index_module =
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen MODULE_CONTEXT_INIT(&mail_index_module_register);
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen mail_search_register_deinit(&mail_search_register_human);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen mail_search_register_deinit(&mail_search_register_imap);
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainenvoid mail_storage_class_register(struct mail_storage *storage_class)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen i_assert(mail_storage_find_class(storage_class->name) == NULL);
2e99f3f3bb35715ce5e0a75a2f2a9bac3ab4224bTimo Sirainen /* append it after the list, so the autodetection order is correct */
2e99f3f3bb35715ce5e0a75a2f2a9bac3ab4224bTimo Sirainen array_append(&mail_storage_classes, &storage_class, 1);
902222fb0928d1701f20a384b73f327b1d9a15ddTimo Sirainenvoid mail_storage_class_unregister(struct mail_storage *storage_class)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen unsigned int i, count;
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen classes = array_get(&mail_storage_classes, &count);
ae8817f05005f57bba32479a610b52d083e2b6ebTimo Sirainen for (i = 0; i < count; i++) {
unsigned int i, count;
for (i = 0; i < count; i++) {
return classes[i];
return NULL;
static struct mail_storage *
unsigned int i, count;
for (i = 0; i < count; i++) {
return classes[i];
return NULL;
p = *data;
static struct mail_storage *
const char *home;
return NULL;
return NULL;
return storage_class;
return storage_class;
return NULL;
const char **error_r)
return FALSE;
return FALSE;
return FALSE;
return TRUE;
static struct mail_storage *
return storage;
return NULL;
const char **error_r)
error_r) < 0)
error_r);
T_BEGIN {
} T_END;
const char *str;
const char *fmt, ...)
T_BEGIN {
} T_END;
T_BEGIN {
} T_END;
error_r);
const char *str;
const char *str;
const struct mail_storage_settings *
void *context)
return error;
const char *error_string;
return FALSE;
return FALSE;
return TRUE;
const struct mailbox_settings *
return NULL;
return *box_set;
return NULL;
T_BEGIN {
if (open_error != 0)
} T_END;
return box;
const char *vname;
&metadata) < 0) {
return box;
return box;
return TRUE;
return TRUE;
return TRUE;
const char *errstr;
errstr);
int ret;
return ret;
const char **error_r)
if (prev_sep) {
return FALSE;
if (prev_sep && i > 0) {
return FALSE;
return TRUE;
vname++;
const char *path;
&path) < 0)
return TRUE;
return FALSE;
const char *name;
name++;
const char *name)
NAMESPACE_FLAG_LIST_CHILDREN)) == 0)
return TRUE;
return FALSE;
case MAIL_ERROR_NOTFOUND:
int ret;
case MAIL_ERROR_NOTFOUND:
MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS) == 0) {
T_BEGIN {
} T_END;
} T_END;
if (ret < 0) {
return FALSE;
return FALSE;
return FALSE;
if (ret < 0)
return FALSE;
return TRUE;
const char *index_dir;
int ret;
&index_dir);
if (ret <= 0)
int ret;
return ret;
const char *name1;
return FALSE;
return TRUE;
bool directory)
int ret;
if (ret == 0) {
return ret;
int ret;
return ret;
int ret;
if (ret < 0)
if (del)
if (del) {
if (ret < 0)
int ret;
return ret;
int ret;
return ret;
const char **error_r)
return TRUE;
return FALSE;
return FALSE;
return TRUE;
const char **error_r)
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
int ret = 0;
return ret;
struct mail_namespace *
return FALSE;
i_unreached();
struct mailbox_sync_context *
return ctx;
T_BEGIN {
} T_END;
return ctx;
return FALSE;
const char *errormsg;
int ret;
if (ret == 0)
return ret;
struct mail_search_context *
int ret;
return ret;
bool tryagain;
if (!tryagain)
return FALSE;
return TRUE;
return FALSE;
return TRUE;
int ret;
if (ret < 0)
return ret;
struct mailbox_transaction_context *
const char *reason)
return trans;
int ret;
return ret;
int ret;
T_BEGIN {
} T_END;
return ret;
struct mailbox *
return t->box;
struct mail_save_context *
T_BEGIN {
} T_END;
return ctx;
const char *const *keywords_list;
const char *envelope)
unsigned int order)
int ret;
} else T_BEGIN {
} T_END;
if (ret < 0) {
int ret;
T_BEGIN {
} T_END;
return ret;
int ret;
T_BEGIN {
} T_END;
if (pvt_flags != 0)
t->save_count++;
return ret;
T_BEGIN {
} T_END;
struct mailbox_transaction_context *
int ret;
T_BEGIN {
} T_END;
if (ret == 0) {
if (pvt_flags != 0)
t->save_count++;
return ret;
int ret;
return ret;
int ret;
if (ret < 0) {
return ret;
const char **path_r)
int *fd_r)
int fd;
const char *root_dir;
int ret;
return ret;
&mail_dir) < 0)
unsigned int secs)
#ifndef MMAP_CONFLICTS_WRITE
return index_flags;
bool *utc_r)
unsigned int secs;
const char *error;
T_BEGIN {
} T_END;
const char **error_r)
const char *lock_path;
bool created;