aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.h
blob: e55bd05805897473f781a657e480c0ab4d1a3cb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _ANTISPAM_PLUGIN_H
#define _ANTISPAM_PLUGIN_H

#include <unistd.h>  
#include "mempool.h"

struct signature {
	struct signature *next;
	char *sig;
};

#ifdef CONFIG_PLUGIN_WANT_SIGNATURE
/*
 * Call backend giving
 *  - pool: dovecot memory pool, will be freed afterwards
 *  - spam: whether mail comes from spam folder or not
 *  - sigs: signatures, next == NULL terminates list
 *  - 
 */
int backend(pool_t pool, int spam, struct signature *sigs);
#elif CONFIG_PLUGIN_WANT_MAIL
#error TODO: no support for pristine training yet
#else
#error BUILD SYSTEM ERROR
#endif

#ifdef CONFIG_DEBUG
void debug(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
#else
static inline void
debug(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)))
{
}
#endif

#endif /* _ANTISPAM_PLUGIN_H */