raw-storage.c revision c0d069950af1dbc6a4e5c3de3bf2e437796e3ae0
e59faf65ce864fe95dc00f5d52b8323cdbd0608aTimo Sirainen/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenstatic struct mail_storage *raw_storage_alloc(void)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen pool = pool_alloconly_create("raw storage", 512+256);
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenraw_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen set->subscription_fname = RAW_SUBSCRIPTION_FILE_NAME;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic struct mailbox *
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainenraw_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen flags |= MAILBOX_FLAG_READONLY | MAILBOX_FLAG_NO_INDEX_FILES;
3b32bc12710240f86465a00fbb2bd1ef030e6c40Timo Sirainen pool = pool_alloconly_create("raw mailbox", 1024*3);
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen index_storage_mailbox_alloc(&mbox->box, vname, flags, NULL);
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen mbox->storage = (struct raw_storage *)storage;
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainenstatic int raw_mailbox_open(struct mailbox *box)
e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)box;
d22301419109ed4a38351715e6760011421dadecTimo Sirainen return index_storage_mailbox_open(box, FALSE);
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen } else if (!mail_storage_set_error_from_errno(box->storage)) {
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen box->input = i_stream_create_fd(fd, MAIL_READ_FULL_BLOCK_SIZE, TRUE);
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen i_stream_set_init_buffer_size(box->input, MAIL_READ_FULL_BLOCK_SIZE);
d22301419109ed4a38351715e6760011421dadecTimo Sirainen return index_storage_mailbox_open(box, FALSE);
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen const struct mailbox_update *update ATTR_UNUSED,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen "Raw mailbox creation isn't supported");
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen const struct mailbox_update *update ATTR_UNUSED)
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
17ad2164c747cedbf81dae1893063e71a3df0356Timo Sirainen "Raw mailbox update isn't supported");
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic void raw_notify_changes(struct mailbox *box ATTR_UNUSED)