#include "array.h"
#include "hex-binary.h"
#include "mail-index.h"
+#include "mail-namespace.h"
#include "mail-storage-private.h"
#include "mail-search.h"
#include "../virtual/virtual-storage.h"
{
fts_backend_set_cur_mailbox(ctx);
+ i_assert(ctx->cur_box != NULL);
+
if (!ctx->backend->v.update_set_build_key(ctx, key))
return FALSE;
ctx->build_key_open = TRUE;
int fts_index_have_compatible_settings(struct mailbox_list *list,
uint32_t checksum)
{
+ struct mail_namespace *ns = mailbox_list_get_namespace(list);
struct mailbox *box;
struct fts_index_header hdr;
+ const char *vname;
+ unsigned int len;
int ret;
- box = mailbox_alloc(list, "INBOX", 0);
+ if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0)
+ vname = "INBOX";
+ else {
+ len = strlen(ns->prefix);
+ if (len > 0 && ns->prefix[len-1] == mail_namespace_get_sep(ns))
+ len--;
+ vname = t_strndup(ns->prefix, len);
+ }
+
+ box = mailbox_alloc(list, vname, 0);
if (mailbox_sync(box, (enum mailbox_sync_flags)0) < 0) {
i_error("lucene: Failed to sync mailbox INBOX: %s",
mailbox_get_last_error(box, NULL));