/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "hash.h"
#include "str.h"
#include "sort.h"
#include "mail-index.h"
#include "mail-storage.h"
#include "mailbox-list-index-sync.h"
static void
{
const char *vname;
mailbox_free(&box);
}
static void
{
/* get mailbox GUID if possible. we need to do this early in here to
make mailbox rename detection work in NOTIFY */
} T_END;
}
static struct mailbox_list_index_node *
struct mailbox_list_index_node *parent,
{
char *dup_name;
struct mailbox_list_index_node, 1);
/* we don't bother doing name deduplication here, even though it would
be possible. */
} else {
}
return node;
}
const char *name,
struct mailbox_list_index_node **node_r,
bool *created_r)
{
unsigned int i;
/* find the last node that exists in the path */
break;
}
/* the entire path exists */
} else {
/* create missing parts of the path */
&seq);
}
}
return seq;
}
static void
const struct mailbox_list_index_node *node)
{
}
}
static void
{
const void *ext_data;
const char *name;
/* get all existing name IDs sorted */
/* add existing names to header (with deduplication) */
POINTER_CAST(*id_p));
}
}
/* make sure header size is ok in index and update it */
sizeof(struct mailbox_list_index_record),
sizeof(uint32_t));
}
}
static void
{
}
}
static void
struct mailbox_list_index_node *node)
{
&seq))
}
}
}
struct mailbox_list_index_sync_context **sync_ctx_r)
{
if (mailbox_list_index_index_open(list) < 0)
return -1;
return -1;
}
/* re-parse mailbox list now that it's refreshed and locked */
return -1;
}
/* unlock and resync the index */
if (mailbox_list_index_handle_corruption(list) < 0)
return -1;
goto retry;
}
if (hdr->uid_validity == 0) {
/* first time indexing, set uidvalidity */
}
*sync_ctx_r = sync_ctx;
return 0;
}
static int
{
bool created;
/* clear EXISTS-flags, so after sync we know what can be expunged */
/* don't include autocreated mailboxes in index until they're
actually created. this index may be used by multiple users, so
we also want to ignore ACLs here. */
flags = 0;
} else {
(enum mail_flags)flags);
}
} T_END;
return -1;
/* successfully listed everything, expunge any unseen mailboxes */
return 0;
}
static void
{
/* new names added. this implicitly resets refresh flag */
T_BEGIN {
} T_END;
/* we're synced, reset refresh flag */
new_hdr.refresh_flag = 0;
}
}
static void
struct mailbox_list_index_node *node)
{
const void *data;
bool expunged;
return;
if (node->corrupted_ext) {
}
if (node->corrupted_flags) {
/* rely on lib-index to drop unnecessary updates */
}
}
static void
struct mailbox_list_index_node *node)
{
}
}
static void
{
return;
}
bool success)
{
int ret;
if (success) {
}
if (success) {
} else {
ret = -1;
}
return ret;
}
{
int ret = 0;
return -1;
/* no backing store - we have nothing to sync to */
} else if (refresh ||
/* sync the index against the backing store */
}
}
const char *name, bool delete_selectable)
{
const void *data;
bool expunged;
return -1;
}
if (delete_selectable) {
/* make it at least non-selectable */
rec.uid_validity = 0;
}
/* can't delete this directory before its children,
but we may have made it non-selectable already */
return 0;
}
/* we can remove the entire node */
return 1;
}