cydir-storage.c revision 4b7cc6ef2e9d848f275965789165939649b6a4de
bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschstatic struct mail_storage *cydir_storage_alloc(void)
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch pool = pool_alloconly_create("cydir storage", 512+256);
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch storage = p_new(pool, struct cydir_storage, 1);
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschcydir_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch set->subscription_fname = CYDIR_SUBSCRIPTION_FILE_NAME;
f74dbd3ff682fea040f60383e001620d1f1b09d3Stephan Boschstatic struct mailbox *
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschcydir_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch /* cydir can't work without index files */
f74dbd3ff682fea040f60383e001620d1f1b09d3Stephan Bosch pool = pool_alloconly_create("cydir mailbox", 1024*3);
f74dbd3ff682fea040f60383e001620d1f1b09d3Stephan Bosch index_storage_mailbox_alloc(&mbox->box, vname, flags, MAIL_INDEX_PREFIX);
f74dbd3ff682fea040f60383e001620d1f1b09d3Stephan Boschstatic int cydir_mailbox_open(struct mailbox *box)
f74dbd3ff682fea040f60383e001620d1f1b09d3Stephan Bosch /* exists, open it */
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
bf3dbfd29e4d65f485b963bb5598b653e65b5f82Phil Carmody mailbox_set_critical(box, "stat(%s) failed: %m", box_path);
bf3dbfd29e4d65f485b963bb5598b653e65b5f82Phil Carmody if (index_storage_mailbox_open(box, FALSE) < 0)
bf3dbfd29e4d65f485b963bb5598b653e65b5f82Phil Carmodycydir_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
bf3dbfd29e4d65f485b963bb5598b653e65b5f82Phil Carmody if ((ret = index_storage_mailbox_create(box, directory)) <= 0)
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschstatic void cydir_notify_changes(struct mailbox *box)
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch mailbox_watch_add(box, mailbox_get_path(box));