cydir-storage.c revision c2ced58969b446666ab1067c6bfdf495367ed621
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen/* Copyright (c) 2007-2008 Dovecot authors, see the included COPYING file */
beb6125ee872e7fed57745ab33e6de99639180f3Timo Sirainen#define CREATE_MODE 0770 /* umask() should limit it more */
d6badc27cd6e8d3398877b6766cb0aaeef3a7800Timo Sirainen MODULE_CONTEXT(obj, cydir_mailbox_list_module)
d6badc27cd6e8d3398877b6766cb0aaeef3a7800Timo Sirainenstatic MODULE_CONTEXT_DEFINE_INIT(cydir_mailbox_list_module,
46c31f64b9f0949f00b7819f45b22f2d64b2ea27Timo Sirainencydir_list_delete_mailbox(struct mailbox_list *list, const char *name);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstatic int cydir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
ae8817f05005f57bba32479a610b52d083e2b6ebTimo Sirainencydir_get_list_settings(struct mailbox_list_settings *list_set,
8d80659e504ffb34bb0c6a633184fece35751b18Timo Sirainen const char *data, enum mail_storage_flags flags,
8d80659e504ffb34bb0c6a633184fece35751b18Timo Sirainen bool debug = (flags & MAIL_STORAGE_FLAG_DEBUG) != 0;
aa38d1a0945f0bc13a225d043f53fad2eec666b1Timo Sirainen list_set->subscription_fname = CYDIR_SUBSCRIPTION_FILE_NAME;
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen if (data == NULL || *data == '\0' || *data == ':') {
beb6125ee872e7fed57745ab33e6de99639180f3Timo Sirainen /* we won't do any guessing for this format. */
1175f27441385a7011629f295f42708f9a3a4ffcTimo Sirainen return mailbox_list_settings_parse(data, list_set, layout_r, NULL,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen pool = pool_alloconly_create("cydir storage", 512+256);
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen storage = p_new(pool, struct cydir_storage, 1);
73e7998716853b5b7621c06aea0022dccda70ad1Timo Sirainenstatic int cydir_create(struct mail_storage *_storage, const char *data,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen const char **error_r)
d6badc27cd6e8d3398877b6766cb0aaeef3a7800Timo Sirainen struct cydir_storage *storage = (struct cydir_storage *)_storage;
24fc71a693331ffe77e2b6d81c70aca6fa055e47Timo Sirainen if (cydir_get_list_settings(&list_set, data, _storage->flags,
09c3a491f4f6ccebe290c7709bdc0d79a187610bTimo Sirainen list_set.mail_storage_flags = &_storage->flags;
985fa802913c96ce6f2e25bbc788ee39c416a7e0Timo Sirainen list_set.lock_method = &_storage->lock_method;
8d80659e504ffb34bb0c6a633184fece35751b18Timo Sirainen if ((_storage->flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) != 0) {
static struct mailbox *
const char *path;
static struct mailbox *
const char *path;
return NULL;
return NULL;
path);
return NULL;
const char *name,
const char *path;
const char *name)
struct dirent *d;
unsigned int dir_len;
errno = 0;
path);
if (!unlinked_something) {
const char *src;
const char *mail_path;
ret = 0;
return ret;
static void cydir_class_init(void)
static void cydir_class_deinit(void)
NULL,
NULL,
NULL,
NULL,