bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "lib.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "ioloop.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "istream.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "index-mail.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "mail-copy.h"
7a7d2aa11e46195e2d92d6c337d7e78052a5ce67Timo Sirainen#include "mailbox-list-private.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "raw-sync.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "raw-storage.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenextern struct mail_storage raw_storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenextern struct mailbox raw_mailbox;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainenstruct mail_user *
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainenraw_storage_create_from_set(const struct setting_parser_info *set_info,
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen const struct mail_user_settings *set)
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen{
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen struct mail_user *user;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen struct mail_namespace *ns;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen struct mail_namespace_settings *ns_set;
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen struct mail_storage_settings *mail_set;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen const char *error;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen
677cc0d62b41c7506246bf1b992a400a11896474Timo Sirainen user = mail_user_alloc(NULL, "raw mail user", set_info, set);
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen user->autocreated = TRUE;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen mail_user_set_home(user, "/");
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen if (mail_user_init(user, &error) < 0)
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen i_fatal("Raw user initialization failed: %s", error);
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns_set = p_new(user->pool, struct mail_namespace_settings, 1);
4d0285870de4f75d65610e700a7c223f3a52bde9Timo Sirainen ns_set->name = "raw-storage";
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns_set->location = ":LAYOUT=none";
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns_set->separator = "/";
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns = mail_namespaces_init_empty(user);
744543d840a229fe893843046d143186971560e2Timo Sirainen /* raw storage doesn't have INBOX. We especially don't want LIST to
744543d840a229fe893843046d143186971560e2Timo Sirainen return INBOX. */
744543d840a229fe893843046d143186971560e2Timo Sirainen ns->flags &= ~NAMESPACE_FLAG_INBOX_USER;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen ns->set = ns_set;
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen /* absolute paths are ok with raw storage */
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen mail_set = p_new(user->pool, struct mail_storage_settings, 1);
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen *mail_set = *ns->mail_set;
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen mail_set->mail_full_filesystem_access = TRUE;
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen ns->mail_set = mail_set;
8dc39d6dd0ee768e611b13694c339fe601ec7337Timo Sirainen
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen if (mail_storage_create(ns, "raw", 0, &error) < 0)
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen i_fatal("Couldn't create internal raw storage: %s", error);
fc4e528886f47bf4d2dd0276fb8705c085c3b9aeTimo Sirainen if (mail_namespaces_init_finish(ns, &error) < 0)
fc4e528886f47bf4d2dd0276fb8705c085c3b9aeTimo Sirainen i_fatal("Couldn't create internal raw namespace: %s", error);
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen return user;
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen}
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainenstatic int ATTR_NULL(2, 3)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainenraw_mailbox_alloc_common(struct mail_user *user, struct istream *input,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen const char *path, time_t received_time,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen const char *envelope_sender, struct mailbox **box_r)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen{
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mail_namespace *ns = user->namespaces;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mailbox *box;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct raw_mailbox *raw_box;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen const char *name;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen name = path != NULL ? path : i_stream_get_name(input);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen box = *box_r = mailbox_alloc(ns->list, name,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen MAILBOX_FLAG_NO_INDEX_FILES);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen if (input != NULL) {
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen if (mailbox_open_stream(box, input) < 0)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return -1;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen } else {
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen if (mailbox_open(box) < 0)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return -1;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen }
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen if (mailbox_sync(box, 0) < 0)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return -1;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen i_assert(strcmp(box->storage->name, RAW_STORAGE_NAME) == 0);
13b2d87842be8864e0e29baa18526b9d5a107b23Josef 'Jeff' Sipek raw_box = RAW_MAILBOX(box);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen raw_box->envelope_sender = envelope_sender;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen raw_box->mtime = received_time;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return 0;
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen}
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainenint raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen time_t received_time, const char *envelope_sender,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mailbox **box_r)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen{
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return raw_mailbox_alloc_common(user, input, NULL, received_time,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen envelope_sender, box_r);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen}
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainenint raw_mailbox_alloc_path(struct mail_user *user, const char *path,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen time_t received_time, const char *envelope_sender,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mailbox **box_r)
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen{
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen return raw_mailbox_alloc_common(user, NULL, path, received_time,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen envelope_sender, box_r);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen}
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenstatic struct mail_storage *raw_storage_alloc(void)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen{
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_storage *storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen pool_t pool;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen pool = pool_alloconly_create("raw storage", 512+256);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen storage = p_new(pool, struct raw_storage, 1);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen storage->storage = raw_storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen storage->storage.pool = pool;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen return &storage->storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen}
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenstatic void
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenraw_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen struct mailbox_list_settings *set)
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen{
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if (set->layout == NULL)
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen set->layout = MAILBOX_LIST_NAME_FS;
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if (set->subscription_fname == NULL)
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen set->subscription_fname = RAW_SUBSCRIPTION_FILE_NAME;
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen}
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic struct mailbox *
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainenraw_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen const char *vname, enum mailbox_flags flags)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen{
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen pool_t pool;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen flags |= MAILBOX_FLAG_READONLY | MAILBOX_FLAG_NO_INDEX_FILES;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
3b32bc12710240f86465a00fbb2bd1ef030e6c40Timo Sirainen pool = pool_alloconly_create("raw mailbox", 1024*3);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen mbox = p_new(pool, struct raw_mailbox, 1);
d22301419109ed4a38351715e6760011421dadecTimo Sirainen mbox->box = raw_mailbox;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen mbox->box.pool = pool;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen mbox->box.storage = storage;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen mbox->box.list = list;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen mbox->box.mail_vfuncs = &raw_mail_vfuncs;
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen index_storage_mailbox_alloc(&mbox->box, vname, flags, "dovecot.index");
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen mbox->mtime = mbox->ctime = (time_t)-1;
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek mbox->storage = RAW_STORAGE(storage);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen mbox->size = (uoff_t)-1;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen return &mbox->box;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen}
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainenstatic int raw_mailbox_open(struct mailbox *box)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen{
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(box);
ca98892a6b8a30ffc1fe26fcf02c7d59e3204e7eTimo Sirainen const char *path;
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen int fd;
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen if (box->input != NULL) {
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen mbox->mtime = mbox->ctime = ioloop_time;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen return index_storage_mailbox_open(box, FALSE);
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen }
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
ca98892a6b8a30ffc1fe26fcf02c7d59e3204e7eTimo Sirainen path = box->_path = box->name;
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen mbox->have_filename = TRUE;
ca98892a6b8a30ffc1fe26fcf02c7d59e3204e7eTimo Sirainen fd = open(path, O_RDONLY);
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen if (fd == -1) {
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen if (ENOTFOUND(errno)) {
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen mail_storage_set_error(box->storage,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen MAIL_ERROR_NOTFOUND,
bdb026e2dc8a7c77585ed5ba489f0056df8074d4Timo Sirainen T_MAIL_ERR_MAILBOX_NOT_FOUND(box->vname));
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen } else if (!mail_storage_set_error_from_errno(box->storage)) {
d4002fe1f64d25a792f76fb102ef7dc519cd4e24Martti Rannanjärvi mailbox_set_critical(box, "open(%s) failed: %m", path);
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen }
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen return -1;
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen }
bace943c67e6cd14ce6c994f533d82a3caad5bf1Timo Sirainen box->input = i_stream_create_fd_autoclose(&fd, MAIL_READ_FULL_BLOCK_SIZE);
ca98892a6b8a30ffc1fe26fcf02c7d59e3204e7eTimo Sirainen i_stream_set_name(box->input, path);
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen i_stream_set_init_buffer_size(box->input, MAIL_READ_FULL_BLOCK_SIZE);
d22301419109ed4a38351715e6760011421dadecTimo Sirainen return index_storage_mailbox_open(box, FALSE);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen}
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenstatic int
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainenraw_mailbox_create(struct mailbox *box,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen const struct mailbox_update *update ATTR_UNUSED,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen bool directory ATTR_UNUSED)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen{
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen "Raw mailbox creation isn't supported");
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen return -1;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen}
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainenstatic int
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainenraw_mailbox_update(struct mailbox *box,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen const struct mailbox_update *update ATTR_UNUSED)
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen{
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen "Raw mailbox update isn't supported");
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen return -1;
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen}
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic void raw_notify_changes(struct mailbox *box ATTR_UNUSED)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen{
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen}
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstruct mail_storage raw_storage = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .name = RAW_STORAGE_NAME,
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen .class_flags = MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE |
d46a1e3f999dda802dc5137e883adcd7a6629cd3Timo Sirainen MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS |
d46a1e3f999dda802dc5137e883adcd7a6629cd3Timo Sirainen MAIL_STORAGE_CLASS_FLAG_BINARY_DATA,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .v = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen NULL,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen raw_storage_alloc,
563273bdac80393af63b9520cbf4d24cc0efd028Timo Sirainen NULL,
c6afd726060aae56b6622c6c52aec10231c4bf1cTimo Sirainen index_storage_destroy,
dca6d617a23e3f93af3b8df59acb46478179fe55Timo Sirainen NULL,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen raw_storage_get_list_settings,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen raw_mailbox_alloc,
857c471c13ca215f4be9dd4b336b742b8d434e31Timo Sirainen NULL,
857c471c13ca215f4be9dd4b336b742b8d434e31Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen }
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen};
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstruct mailbox raw_mailbox = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .v = {
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_is_readonly,
a2f250a332dfc1e6cd4ffd196c621eb9dbf7b8a1Timo Sirainen index_storage_mailbox_enable,
306cfd77100131c08b243de10f6d40500f4c27c6Timo Sirainen index_storage_mailbox_exists,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen raw_mailbox_open,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen index_storage_mailbox_close,
438f12d7a776da695019114884b48188d94613efTimo Sirainen index_storage_mailbox_free,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen raw_mailbox_create,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen raw_mailbox_update,
61b0637759146621cbb7edcbd0b03a71cfd66dfeTimo Sirainen index_storage_mailbox_delete,
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen index_storage_mailbox_rename,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_get_status,
5b6854f83e7fbfd5df4742f1bfc4114099b501a8Timo Sirainen index_mailbox_get_metadata,
6469cf211a57433335641725dc236ebb2b9fdd3bTimo Sirainen index_storage_set_subscribed,
62041dfb7d6ac6e9c633a557075999cdfcff7bd5Timo Sirainen index_storage_attribute_set,
62041dfb7d6ac6e9c633a557075999cdfcff7bd5Timo Sirainen index_storage_attribute_get,
62041dfb7d6ac6e9c633a557075999cdfcff7bd5Timo Sirainen index_storage_attribute_iter_init,
62041dfb7d6ac6e9c633a557075999cdfcff7bd5Timo Sirainen index_storage_attribute_iter_next,
62041dfb7d6ac6e9c633a557075999cdfcff7bd5Timo Sirainen index_storage_attribute_iter_deinit,
c0d069950af1dbc6a4e5c3de3bf2e437796e3ae0Timo Sirainen index_storage_list_index_has_changed,
c0d069950af1dbc6a4e5c3de3bf2e437796e3ae0Timo Sirainen index_storage_list_index_update_sync,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen raw_storage_sync_init,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_mailbox_sync_next,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_mailbox_sync_deinit,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen raw_notify_changes,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_transaction_begin,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_transaction_commit,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_transaction_rollback,
ecdce39e5ef4b62eefa9f5818f17d153fd5d710aTimo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_mail_alloc,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_search_init,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_search_deinit,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_search_next_nonblock,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_search_next_update_seq,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen NULL,
e3aeeb634245e80d4f643f8d2eea11d6b72336d8Timo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen mail_storage_copy,
1460ef7a18c53216ddb4a94bb62fba96076aae8eTimo Sirainen NULL,
1460ef7a18c53216ddb4a94bb62fba96076aae8eTimo Sirainen NULL,
1460ef7a18c53216ddb4a94bb62fba96076aae8eTimo Sirainen NULL,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen index_storage_is_inconsistent
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen }
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen};