summaryrefslogtreecommitdiffstats
path: root/src/rspamd_proxy.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-24 15:56:10 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-24 15:56:10 +0000
commit501f92d766606926351fd2c6593815a62f128ee0 (patch)
tree002817a3d5561577f461e3403ff75a20fd64eeb9 /src/rspamd_proxy.c
parent79988224165a086c098d184faf68456354c70c00 (diff)
downloadrspamd-501f92d766606926351fd2c6593815a62f128ee0.tar.gz
rspamd-501f92d766606926351fd2c6593815a62f128ee0.zip
[Feature] Allow to specify custom rejection message in milter
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r--src/rspamd_proxy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 47dbf606d..fc4b43bea 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -150,6 +150,8 @@ struct rspamd_proxy_ctx {
gchar *spam_header;
/* CA name that can be used for client certificates */
gchar *client_ca_name;
+ /* Milter rejection message */
+ gchar *reject_message;
/* Sessions cache */
void *sessions_cache;
struct rspamd_milter_context milter_ctx;
@@ -848,6 +850,14 @@ init_rspamd_proxy (struct rspamd_config *cfg)
G_STRUCT_OFFSET (struct rspamd_proxy_ctx, client_ca_name),
0,
"Allow certificates issued by this CA to be treated as client certificates");
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "reject_message",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_proxy_ctx, reject_message),
+ 0,
+ "Use custom rejection message");
return ctx;
}
@@ -2179,6 +2189,7 @@ start_rspamd_proxy (struct rspamd_worker *worker) {
ctx->milter_ctx.quarantine_on_reject = ctx->quarantine_on_reject;
ctx->milter_ctx.sessions_cache = ctx->sessions_cache;
ctx->milter_ctx.client_ca_name = ctx->client_ca_name;
+ ctx->milter_ctx.reject_message = ctx->reject_message;
rspamd_milter_init_library (&ctx->milter_ctx);
rspamd_lua_run_postloads (ctx->cfg->lua_state, ctx->cfg, ctx->ev_base,