summaryrefslogtreecommitdiffstats
path: root/src/libserver
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/libserver
parent79988224165a086c098d184faf68456354c70c00 (diff)
downloadrspamd-501f92d766606926351fd2c6593815a62f128ee0.tar.gz
rspamd-501f92d766606926351fd2c6593815a62f128ee0.zip
[Feature] Allow to specify custom rejection message in milter
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/milter.c11
-rw-r--r--src/libserver/milter.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index fca4d44fb..3a3f9af14 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -1787,8 +1787,15 @@ rspamd_milter_send_task_results (struct rspamd_milter_session *session,
sizeof (RSPAMD_MILTER_XCODE_REJECT) - 1);
if (!reply) {
- reply = rspamd_fstring_new_init (RSPAMD_MILTER_REJECT_MESSAGE,
- sizeof (RSPAMD_MILTER_REJECT_MESSAGE) - 1);
+ if (milter_ctx->reject_message == NULL) {
+ reply = rspamd_fstring_new_init (
+ RSPAMD_MILTER_REJECT_MESSAGE,
+ sizeof (RSPAMD_MILTER_REJECT_MESSAGE) - 1);
+ }
+ else {
+ reply = rspamd_fstring_new_init (milter_ctx->reject_message,
+ strlen (milter_ctx->reject_message));
+ }
}
rspamd_milter_set_reply (session, rcode, xcode, reply);
diff --git a/src/libserver/milter.h b/src/libserver/milter.h
index 131843755..35dc8f908 100644
--- a/src/libserver/milter.h
+++ b/src/libserver/milter.h
@@ -47,6 +47,7 @@ struct rspamd_http_message;
struct rspamd_milter_context {
const gchar *spam_header;
const gchar *client_ca_name;
+ const gchar *reject_message;
void *sessions_cache;
gboolean discard_on_reject;
gboolean quarantine_on_reject;