commit b67c7ca: [Feature] Allow to add messages from settings

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Mar 20 14:35:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-20 14:32:11 +0000
URL: https://github.com/rspamd/rspamd/commit/b67c7cadcfc5bd0840440a31993c145fc7278483 (HEAD -> master)

[Feature] Allow to add messages from settings

---
 src/plugins/lua/settings.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

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


More information about the Commits mailing list