diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-26 09:23:31 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-26 09:23:31 +0000 |
commit | 5a576bfdff4356ee578978ee2988dca6f759cd28 (patch) | |
tree | 2df55edc9b61aa245223984671a5de975a376e63 /src | |
parent | 1d7934a2d2d9b87af56dc87768e050901aa9bc09 (diff) | |
download | rspamd-5a576bfdff4356ee578978ee2988dca6f759cd28.tar.gz rspamd-5a576bfdff4356ee578978ee2988dca6f759cd28.zip |
Allow to add symbols from settings
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/settings.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 8c464431d..0003d0b64 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -200,10 +200,10 @@ local function check_settings(task) if res then if rule['whitelist'] then - return {whitelist = true} - else - return rule['apply'] + rule['apply'] = {whitelist = true} end + + return rule end return nil @@ -246,7 +246,15 @@ local function check_settings(task) if rule then rspamd_logger.infox(task, "<%1> apply settings according to rule %2", task:get_message_id(), name) - task:set_settings(rule) + if rule['apply'] then + task:set_settings(rule) + end + if rule['symbols'] then + -- Add symbols, specified in the settings + each(function(val) + task:insert_result(val, 1.0) + end, rule['symbols']) + end end end end |