fts-lucene-plugin.c revision 57b523eeb99ed5d7f5002907a409cdef54353ce5
5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen/* Copyright (c) 2006-2014 Dovecot authors, see the included COPYING file */
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainenconst char *fts_lucene_plugin_version = DOVECOT_ABI_VERSION;
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainenstruct fts_lucene_user_module fts_lucene_user_module =
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen MODULE_CONTEXT_INIT(&mail_user_module_register);
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainenfts_lucene_plugin_init_settings(struct mail_user *user,
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen const char *str)
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen const char *const *tmp;
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen for (tmp = t_strsplit_spaces(str, " "); *tmp != NULL; tmp++) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen if (strncmp(*tmp, "default_language=", 17) == 0) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen } else if (strncmp(*tmp, "textcat_conf=", 13) == 0) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen set->textcat_conf = p_strdup(user->pool, *tmp + 13);
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen } else if (strncmp(*tmp, "textcat_dir=", 12) == 0) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen set->textcat_dir = p_strdup(user->pool, *tmp + 12);
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen } else if (strncmp(*tmp, "whitespace_chars=", 17) == 0) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen set->whitespace_chars = p_strdup(user->pool, *tmp + 17);
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen } else if (strcmp(*tmp, "no_snowball") == 0) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen i_error("fts_lucene: Invalid setting: %s", *tmp);
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen if (set->textcat_conf != NULL && set->textcat_dir == NULL) {
82d3a1d1594ed93d04d7bf999027b3e5104de6e4Timo Sirainen i_error("fts_lucene: textcat_conf set, but textcat_dir unset");
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen if (set->textcat_conf == NULL && set->textcat_dir != NULL) {
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen i_error("fts_lucene: textcat_dir set, but textcat_conf unset");
b014857be9961acf2d37ef7b76d941b20cc8c2d1Timo Sirainen "but Dovecot built without stemmer support");
#ifndef HAVE_LUCENE_TEXTCAT
return crc;
const char *env;
void fts_lucene_plugin_deinit(void)