summaryrefslogtreecommitdiffstats
path: root/src/rspamd_proxy.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-05 08:31:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-05 08:31:17 +0100
commit2a243ba4f114f07b17f3181e5de74f0349a363fe (patch)
tree1792a1eb7ed35082b4de100e9a7de118805ecbba /src/rspamd_proxy.c
parent7a37d46e75db665dc09dda503d59fd0db6ed4813 (diff)
downloadrspamd-2a243ba4f114f07b17f3181e5de74f0349a363fe.tar.gz
rspamd-2a243ba4f114f07b17f3181e5de74f0349a363fe.zip
[Feature] Allow to discard messages instead of rejection
Issue: #1723
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r--src/rspamd_proxy.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 4228ebef0..efb7e957b 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -131,6 +131,8 @@ struct rspamd_proxy_ctx {
gboolean has_self_scan;
/* It is not HTTP but milter proxy */
gboolean milter;
+ /* Discard messages instead of rejecting them */
+ gboolean discard_on_reject;
/* Milter spam header */
gchar *spam_header;
/* Sessions cache */
@@ -791,6 +793,14 @@ init_rspamd_proxy (struct rspamd_config *cfg)
"Accept milter connections, not HTTP");
rspamd_rcl_register_worker_option (cfg,
type,
+ "discard_on_reject",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_proxy_ctx, discard_on_reject),
+ 0,
+ "Tell MTA to discard rejected messages silently");
+ rspamd_rcl_register_worker_option (cfg,
+ type,
"spam_header",
rspamd_rcl_parse_struct_string,
ctx,
@@ -2063,7 +2073,8 @@ start_rspamd_proxy (struct rspamd_worker *worker) {
ctx->ev_base);
}
- rspamd_milter_init_library (ctx->spam_header, ctx->sessions_cache);
+ rspamd_milter_init_library (ctx->spam_header, ctx->sessions_cache,
+ ctx->discard_on_reject);
event_base_loop (ctx->ev_base, 0);
rspamd_worker_block_signals ();