#ifndef ANTISPAM_SETTINGS_H
#define ANTISPAM_SETTINGS_H

enum antispam_debug_target {
	ADT_NONE,
	ADT_STDERR,
	ADT_SYSLOG,
};

enum match_type {
	MT_REG,
	MT_PATTERN,
	MT_PATTERN_IGNCASE,

	/* keep last */
	NUM_MT
};

struct antispam_settings {
	pool_t pool;

	/* debug */
	const char *_debug_target;
	enum antispam_debug_target debug_target;
	unsigned int verbose_debug;
	const char *debug_prefix;

	const char *_backend;

	const char *signature;
	const char *signature_missing;

	const char *_spam_keywords;

	const char *_trash;
	const char *_trash_pattern;
	const char *_trash_pattern_ignorecase;

	const char *_spam;
	const char *_spam_pattern;
	const char *_spam_pattern_ignorecase;

	const char *_unsure;
	const char *_unsure_pattern;
	const char *_unsure_pattern_ignorecase;

	bool allow_append_to_spam;

	const char *dspam_binary;
	const char *_dspam_args;
	const char *dspam_result_header;
	const char *_dspam_result_blacklist;
	const char *_dspam_env;

	const char *pipe_program;
	const char *_pipe_program_args;
	const char *_pipe_program_spam_args;
	const char *_pipe_program_notspam_args;
	const char *pipe_tmpdir;

	const char *crm_binary;
	const char *_crm_args;
	const char *_crm_env;

	const char *spool2dir_spam;
	const char *spool2dir_notspam;

	/* calculated fields: */
	struct backend *backend;

	/*
	 * There are three different matches for each folder type
	 *
	 * type			usage
	 * ----------------------------
	 * MT_REG		plain strcmp()
	 * MT_PATTERN		case sensitive match with possible wildcards
	 * MT_PATTERN_IGNCASE	case insensitive match with possible wildcards
	 */
	struct antispam_folders {
		char **folders[NUM_MT];
	} trash, spam, unsure;

	char **dspam_args;
	int dspam_args_num;
	char **dspam_result_blacklist;
	char **dspam_env;

	char **pipe_program_args;
	int pipe_program_args_num;
	char **pipe_program_spam_args;
	int pipe_program_spam_args_num;
	char **pipe_program_notspam_args;
	int pipe_program_notspam_args_num;

	char **crm_args;
	int crm_args_num;
	char **crm_env;

	char **spam_keywords;

	bool need_folder_hook;
	bool signature_missing_ok;
};

#endif /* ANTISPAM_SETTINGS_H */
