From 501f92d766606926351fd2c6593815a62f128ee0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 24 Mar 2018 15:56:10 +0000 Subject: [Feature] Allow to specify custom rejection message in milter --- src/rspamd_proxy.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/rspamd_proxy.c') 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, -- cgit v1.2.3