bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenstatic struct mail_storage *cydir_storage_alloc(void)
f7539a17ea306191b53b8f5e752e228937df9ec3Timo Sirainen pool = pool_alloconly_create("cydir storage", 512+256);
f7539a17ea306191b53b8f5e752e228937df9ec3Timo Sirainen storage = p_new(pool, struct cydir_storage, 1);
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainencydir_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen set->subscription_fname = CYDIR_SUBSCRIPTION_FILE_NAME;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic struct mailbox *
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainencydir_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen /* cydir can't work without index files */
3b32bc12710240f86465a00fbb2bd1ef030e6c40Timo Sirainen pool = pool_alloconly_create("cydir mailbox", 1024*3);
8c909e451d14075c05d90382cf8eebc4e354f569Timo Sirainen index_storage_mailbox_alloc(&mbox->box, vname, flags, MAIL_INDEX_PREFIX);
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainenstatic int cydir_mailbox_open(struct mailbox *box)
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen /* exists, open it */
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
d4002fe1f64d25a792f76fb102ef7dc519cd4e24Martti Rannanjärvi mailbox_set_critical(box, "stat(%s) failed: %m", box_path);
df00412606a00714a6e85383fa87fbdc7cc1fb5bTimo Sirainen if (index_storage_mailbox_open(box, FALSE) < 0)
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainencydir_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
3d6fdafca17c073606b63745ca8638e035e871f4Timo Sirainen if ((ret = index_storage_mailbox_create(box, directory)) <= 0)
f81f4bc282cd1944cec187bae89c0701a416ed2aTimo Sirainenstatic void cydir_notify_changes(struct mailbox *box)
7e2671b295927b461adc8b6c4ed6a1c4761fb323Timo Sirainen mailbox_watch_add(box, mailbox_get_path(box));