aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-07 19:38:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-07 22:13:18 +0100
commit79d878219f27f3bffa196e11aae9677e4391bb47 (patch)
treedf14648bef1ea2cd36cb4b6146af0a3bddbb9c02 /src
parent43a7dcf95ad96b7dbf912ab3da2c74fc243f2845 (diff)
downloadrspamd-79d878219f27f3bffa196e11aae9677e4391bb47.tar.gz
rspamd-79d878219f27f3bffa196e11aae9677e4391bb47.zip
[Minor] Allow `spam_header` configuration option in the proxy
Diffstat (limited to 'src')
-rw-r--r--src/rspamd_proxy.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 22064c570..1b30827e7 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -129,6 +129,8 @@ struct rspamd_proxy_ctx {
gboolean has_self_scan;
/* It is not HTTP but milter proxy */
gboolean milter;
+ /* Milter spam header */
+ gchar *spam_header;
};
enum rspamd_backend_flags {
@@ -783,6 +785,14 @@ init_rspamd_proxy (struct rspamd_config *cfg)
G_STRUCT_OFFSET (struct rspamd_proxy_ctx, milter),
0,
"Accept milter connections, not HTTP");
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "spam_header",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_proxy_ctx, spam_header),
+ 0,
+ "Use the specific spam header instead of X-Spam");
return ctx;
}
@@ -2023,6 +2033,10 @@ start_rspamd_proxy (struct rspamd_worker *worker) {
rspamd_worker_init_scanner (worker, ctx->ev_base, ctx->resolver);
}
+ if (ctx->spam_header) {
+ rspamd_milter_init_library (ctx->spam_header);
+ }
+
event_base_loop (ctx->ev_base, 0);
rspamd_worker_block_signals ();