#include "mail-storage-private.h"
#include "fts-plugin.h"
+#include <stdlib.h>
+
const char *fts_plugin_version = PACKAGE_VERSION;
void (*fts_next_hook_mailbox_opened)(struct mailbox *box);
void fts_plugin_init(void)
{
- fts_next_hook_mailbox_opened = hook_mailbox_opened;
- hook_mailbox_opened = fts_mailbox_opened;
+ if (getenv("FTS") != NULL) {
+ fts_next_hook_mailbox_opened = hook_mailbox_opened;
+ hook_mailbox_opened = fts_mailbox_opened;
+ } else if (getenv("DEBUG") != NULL)
+ i_info("fts: Missing fts setting, disabled");
}
void fts_plugin_deinit(void)
fbox->backend_fast = backend;
}
}
+ if ((box->storage->flags & MAIL_STORAGE_FLAG_DEBUG) != 0 &&
+ fbox->backend_substr == NULL && fbox->backend_fast == NULL)
+ i_info("fts: No backends enabled by the fts setting");
}
static struct mailbox_transaction_context *
const char *env;
env = getenv("FTS");
- if (env != NULL)
- fts_mailbox_init(box, env);
+ i_assert(env != NULL);
+ fts_mailbox_init(box, env);
if (fts_next_hook_mailbox_opened != NULL)
fts_next_hook_mailbox_opened(box);