diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/settings.lua | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 970062d3b..7ad85d184 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -316,22 +316,8 @@ local function check_settings(task) end end - if rule['selector'] then - local sel = selectors_cache[rule_name] - if not sel then - sel = lua_selectors.create_selector_closure(rspamd_config, rule.selector, - rule.delimiter or "") - - if sel then - selectors_cache[rule_name] = sel - end - end - - if sel then - if sel(task) then - res = true - end - end + if rule.selector then + res = rule.selector(task) end if res then @@ -602,6 +588,22 @@ local function process_settings_table(tbl) end end + if elt['selector'] then + local sel = selectors_cache[name] + if not sel then + sel = lua_selectors.create_selector_closure(rspamd_config, elt.selector, + elt.delimiter or "") + + if sel then + selectors_cache[name] = sel + end + end + + if sel then + out['selector'] = sel + end + end + -- Now we must process actions if elt['symbols'] then out['symbols'] = elt['symbols'] end if elt['id'] then |