aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-20 14:32:11 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-20 14:32:11 +0000
commitb67c7cadcfc5bd0840440a31993c145fc7278483 (patch)
tree67d91c4529ac4fc129c0ddce76193f087acc1680
parentce14a950a69c4b8e749b7d2c647105c823b8a6a2 (diff)
downloadrspamd-b67c7cadcfc5bd0840440a31993c145fc7278483.tar.gz
rspamd-b67c7cadcfc5bd0840440a31993c145fc7278483.zip
[Feature] Allow to add messages from settings
-rw-r--r--src/plugins/lua/settings.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 972375b32..04067211e 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -82,6 +82,14 @@ local function apply_settings(task, to_apply)
if to_apply.subject then
task:set_metric_subject(to_apply.subject)
end
+
+ -- E.g.
+ -- messages = { smtp_message = "5.3.1 Go away" }
+ if to_apply.messages and type(to_apply.messages) == 'table' then
+ fun.each(function(category, message)
+ task:append_message(message, category)
+ end, to_apply.messages)
+ end
end
-- Checks for overridden settings within query params and returns 'true' if