From 7910d2525344868b9d7694deb18a16f76756ad94 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 2 Mar 2009 15:57:25 +0300 Subject: [PATCH] * Add forgotten file --- src/plugins/surbl.h | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/plugins/surbl.h diff --git a/src/plugins/surbl.h b/src/plugins/surbl.h new file mode 100644 index 0000000000..196f4517c1 --- /dev/null +++ b/src/plugins/surbl.h @@ -0,0 +1,69 @@ +#ifndef RSPAMD_MODULE_SURBL +#define RSPAMD_MODULE_SURBL + +#include "../config.h" +#include "../main.h" +#include "../modules.h" +#include "../cfg_file.h" +#include "../memcached.h" + +#define DEFAULT_REDIRECTOR_PORT 8080 +#define DEFAULT_SURBL_WEIGHT 10 +#define DEFAULT_REDIRECTOR_CONNECT_TIMEOUT 1000 +#define DEFAULT_REDIRECTOR_READ_TIMEOUT 5000 +#define DEFAULT_SURBL_MAX_URLS 1000 +#define DEFAULT_SURBL_URL_EXPIRE 86400 +#define DEFAULT_SURBL_SYMBOL "SURBL_DNS" +#define DEFAULT_SURBL_SUFFIX "multi.surbl.org" + + +struct surbl_ctx { + int (*header_filter)(struct worker_task *task); + int (*mime_filter)(struct worker_task *task); + int (*message_filter)(struct worker_task *task); + int (*url_filter)(struct worker_task *task); + struct in_addr redirector_addr; + uint16_t redirector_port; + uint16_t weight; + unsigned int connect_timeout; + unsigned int read_timeout; + unsigned int max_urls; + unsigned int url_expire; + GList *suffixes; + char *symbol; + char *metric; + GHashTable *hosters; + GHashTable *whitelist; + unsigned use_redirector; + memory_pool_t *surbl_pool; +}; + +struct suffix_item { + const char *suffix; + const char *symbol; +}; + +struct dns_param { + struct uri *url; + struct worker_task *task; + struct suffix_item *suffix; +}; + +struct redirector_param { + struct uri *url; + struct worker_task *task; + enum { + STATE_CONNECT, + STATE_READ, + } state; + struct event ev; + int sock; +}; + +struct memcached_param { + struct uri *url; + struct worker_task *task; + memcached_ctx_t *ctx; +}; + +#endif -- 2.47.3