mdbox-storage.c revision 62041dfb7d6ac6e9c633a557075999cdfcff7bd5
/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "mkdir-parents.h"
#include "master-service.h"
#include "mail-index-modseq.h"
#include "mail-index-alloc-cache.h"
#include "mailbox-log.h"
#include "mailbox-list-private.h"
#include "dbox-mail.h"
#include "dbox-save.h"
#include "mdbox-map.h"
#include "mdbox-file.h"
#include "mdbox-sync.h"
#include "mdbox-storage-rebuild.h"
#include "mdbox-storage.h"
extern struct mail_storage mdbox_storage;
extern struct mailbox mdbox_mailbox;
extern struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs;
static struct mail_storage *mdbox_storage_alloc(void)
{
struct mdbox_storage *storage;
}
static int
const char **error_r)
{
const char *dir;
*error_r = "mdbox: MAILBOXDIR must not be empty";
return -1;
}
}
{
}
static const char *
{
if (debug)
return path;
}
if (debug)
}
return NULL;
}
struct mailbox_list_settings *set)
{
else {
if (debug)
i_debug("mdbox: couldn't find root dir");
return FALSE;
}
}
if (debug)
return FALSE;
}
if (debug)
return FALSE;
}
return TRUE;
}
static struct mailbox *
{
struct mdbox_mailbox *mbox;
struct index_mailbox_context *ibox;
/* dbox can't work without index files */
}
{
if (dbox_mailbox_open(box) < 0)
return -1;
sizeof(struct mdbox_mail_index_record),
sizeof(uint32_t));
mbox->hdr_ext_id =
sizeof(struct mdbox_index_header), 0, 0);
mbox->guid_ext_id =
0, GUID_128_SIZE, 1);
return 0;
}
{
(void)mdbox_storage_rebuild(mstorage);
}
struct mdbox_index_header *hdr)
{
const void *data;
if (data_size < MDBOX_INDEX_HEADER_MIN_SIZE &&
"mdbox %s: Invalid dbox header size: %"PRIuSIZE_T,
return -1;
}
return 0;
}
struct mail_index_transaction *trans,
const struct mailbox_update *update)
{
sizeof(new_hdr.mailbox_guid));
}
}
}
const struct mailbox_update *update,
struct mail_index_transaction *trans)
{
struct mail_index_view *view;
const struct mail_index_header *hdr;
return -1;
}
else if (uid_validity == 0) {
/* set uidvalidity */
}
}
}
}
}
if (mail_index_transaction_commit(&new_trans) < 0) {
return -1;
}
}
return 0;
}
const struct mailbox_update *update,
struct mail_index_transaction *trans)
{
int ret;
return ret;
}
{
/* already set it corrupted (possibly recursing back here) */
return;
}
}
}
static const char *
{
return "";
}
{
}
{
}
static int
{
struct mdbox_index_header hdr;
/* regenerate it */
return -1;
}
return 0;
}
static int
enum mailbox_metadata_items items,
struct mailbox_metadata *metadata_r)
{
return -1;
if ((items & MAILBOX_METADATA_GUID) != 0) {
return -1;
}
return 0;
}
static int
{
if (mailbox_open(box) < 0)
return -1;
}
}
struct mail_storage mdbox_storage = {
.v = {
NULL,
}
};
struct mailbox mdbox_mailbox = {
.v = {
NULL,
NULL,
}
};
struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs = {
};