aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/surbl.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 15:57:25 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 15:57:25 +0300
commit7910d2525344868b9d7694deb18a16f76756ad94 (patch)
tree34fbf37607800f75c79f2a524c2b829e85d2d5e0 /src/plugins/surbl.h
parentd325896c10f39606cb39382bcf8c023950d69880 (diff)
downloadrspamd-7910d2525344868b9d7694deb18a16f76756ad94.tar.gz
rspamd-7910d2525344868b9d7694deb18a16f76756ad94.zip
* Add forgotten file
Diffstat (limited to 'src/plugins/surbl.h')
-rw-r--r--src/plugins/surbl.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/plugins/surbl.h b/src/plugins/surbl.h
new file mode 100644
index 000000000..196f4517c
--- /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