bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#include "lib.h"
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen#include "mail-storage-hooks.h"
1537d20b852cbbf0d6971790b84e0cce5ca61307Timo Sirainen#include "fts-filter.h"
4ef1f9f3293965734e6e3c38c191ceb2246a721fTeemu Huovila#include "fts-tokenizer.h"
3ad57148af55e45cc45401162d3460ed0b237a10Timo Sirainen#include "fts-parser.h"
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen#include "fts-storage.h"
1537d20b852cbbf0d6971790b84e0cce5ca61307Timo Sirainen#include "fts-user.h"
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#include "fts-plugin.h"
6dd785e6857866657d6ef7a88af6d46ed0133801Teemu Huovila#include "fts-library.h"
14bb36cbb67b42e32105c3d843a8c974dc7ed436Timo Sirainen
bd63b5b860658b01b1f46f26d406e1e4a9dc019aTimo Sirainenconst char *fts_plugin_version = DOVECOT_ABI_VERSION;
f6c1297c26b355c4aec2a08978f51ec3efecb351Timo Sirainen
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainenstatic struct mail_storage_hooks fts_mail_storage_hooks = {
2bc82f0d7e717f600bcaaa15356cf9bfe26fb633Aki Tuomi .mail_namespaces_added = fts_mail_namespaces_added,
79195413c349af7f9ce26871bf79c70af07ea7ceAki Tuomi .mailbox_list_created = fts_mailbox_list_created,
539977f9257bd8985be5a8093658da266ae9cd19Timo Sirainen .mailbox_allocated = fts_mailbox_allocated,
539977f9257bd8985be5a8093658da266ae9cd19Timo Sirainen .mail_allocated = fts_mail_allocated
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen};
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainenvoid fts_plugin_init(struct module *module)
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen{
6dd785e6857866657d6ef7a88af6d46ed0133801Teemu Huovila fts_library_init();
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen mail_storage_hooks_add(module, &fts_mail_storage_hooks);
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen}
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainenvoid fts_plugin_deinit(void)
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen{
6dd785e6857866657d6ef7a88af6d46ed0133801Teemu Huovila fts_library_deinit();
3ad57148af55e45cc45401162d3460ed0b237a10Timo Sirainen fts_parsers_unload();
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen mail_storage_hooks_remove(&fts_mail_storage_hooks);
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen}