aboutsummaryrefslogtreecommitdiffstats
path: root/antispam-plugin.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-01 14:17:23 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-01 14:17:23 +0200
commit74b2bd7184ad32939235be32452d3569bba67370 (patch)
tree24e2113b9599241793cb0ae38e7bc1fa2736aad4 /antispam-plugin.h
parent40c43ecda62039059360b400dde4dc44edc67c3a (diff)
downloaddovecot-antispam-74b2bd7184ad32939235be32452d3569bba67370.tar.gz
dovecot-antispam-74b2bd7184ad32939235be32452d3569bba67370.tar.xz
dovecot-antispam-74b2bd7184ad32939235be32452d3569bba67370.zip
start box plugin experiment, seems not to work
Diffstat (limited to 'antispam-plugin.h')
-rw-r--r--antispam-plugin.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/antispam-plugin.h b/antispam-plugin.h
new file mode 100644
index 0000000..7d9003b
--- /dev/null
+++ b/antispam-plugin.h
@@ -0,0 +1,42 @@
+#ifndef _ANTISPAM_PLUGIN_H
+#define _ANTISPAM_PLUGIN_H
+
+#include "lib.h"
+#include "str.h"
+#include "client.h"
+#include "ostream.h"
+#include "imap-search.h"
+
+struct antispam_transaction_context;
+
+/*
+ * 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
+ * -
+ */
+void backend_init(pool_t pool);
+void backend_exit(void);
+int backend_handle_mail(struct mailbox_transaction_context *t,
+ struct antispam_transaction_context *ast,
+ struct mail *mail);
+struct antispam_transaction_context *backend_start(struct mailbox *box);
+void backend_rollback(struct antispam_transaction_context *ast);
+int backend_commit(struct antispam_transaction_context *ast);
+
+#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
+
+void antispam_mail_storage_created(struct mail_storage *storage);
+void (*antispam_next_hook_mail_storage_created)(struct mail_storage *storage);
+bool mailbox_is_spam(struct mail_storage *storage, struct mailbox *box);
+bool mailbox_is_trash(struct mail_storage *storage, struct mailbox *box);
+
+#endif /* _ANTISPAM_PLUGIN_H */