aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.h
blob: c2281ad0468a1d009e43ab0fe37bb1f272ca15c0 (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
37
38
39
40
#ifndef _ANTISPAM_PLUGIN_H
#define _ANTISPAM_PLUGIN_H

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

struct strlist {
	struct strlist *next;
	const char *str;
};

#ifdef BACKEND_WANTS_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
 *  - 
 */
bool backend(pool_t pool, bool spam, struct strlist *sigs);
#elif CONFIG_PLUGIN_WANT_MAIL
#error TODO: no support for pristine training yet
#else
#error BUILD SYSTEM ERROR
#endif

void backend_init(pool_t pool);
void backend_exit(void);

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

#endif /* _ANTISPAM_PLUGIN_H */