]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow to add messages from settings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Mar 2019 14:32:11 +0000 (14:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Mar 2019 14:32:11 +0000 (14:32 +0000)
src/plugins/lua/settings.lua

index 972375b32233a31758aefafe3aabd167035f583c..04067211e2db7b3175ff2c0d6b5b64dee1575676 100644 (file)
@@ -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