commit 8d757de: [Minor] Settings: Minor case fix

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jan 24 14:42:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-01-24 14:35:20 +0000
URL: https://github.com/rspamd/rspamd/commit/8d757de7fdd3bbf9a16e244acb60e13de3187699 (HEAD -> master)

[Minor] Settings: Minor case fix

---
 src/plugins/lua/settings.lua | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 300462002..84e76f78c 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -127,10 +127,17 @@ local function check_query_settings(task)
     -- settings_id is rspamd text, so need to convert it to string for lua
     local id_str = tostring(settings_id)
     local elt = settings_ids[id_str]
-    if elt and elt['apply'] then
-      apply_settings(task, elt['apply'])
-      rspamd_logger.infox(task, "applying settings id %s", id_str)
-      return true
+
+    if elt then
+      if elt['whitelist'] then
+        elt['apply'] = {whitelist = true}
+      end
+
+      if elt.apply then
+        apply_settings(task, elt['apply'])
+        rspamd_logger.infox(task, "applying settings id %s", id_str)
+        return true
+      end
     end
   end
 


More information about the Commits mailing list