view src/plugins/fts/fts-plugin.c @ 8404:d3cbd3494a8c HEAD

Plugins: If mail_debug=yes, log "plugin disabled" if plugin's required setting isn't set.
author Timo Sirainen <tss@iki.fi>
date Sat, 15 Nov 2008 19:22:33 +0200
parents 16a99d3a34dd
children b9faf4db2a9f
line wrap: on
line source

/* Copyright (c) 2006-2008 Dovecot authors, see the included COPYING file */

#include "lib.h"
#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)
{
	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: No fts setting - plugin disabled");
}

void fts_plugin_deinit(void)
{
	if (hook_mailbox_opened == fts_mailbox_opened)
		hook_mailbox_opened = fts_next_hook_mailbox_opened;
}