aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/external_services.lua
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-13 17:55:24 +0100
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-13 17:55:24 +0100
commit2134040728963f49ce866fa8cd9158539bd9ee03 (patch)
tree21148bdc0e37e9ba77ce0c2bbc4fd704d607c784 /src/plugins/lua/external_services.lua
parentd68a5f42a33d8830d268c2cc581469fa0381fa6c (diff)
downloadrspamd-2134040728963f49ce866fa8cd9158539bd9ee03.tar.gz
rspamd-2134040728963f49ce866fa8cd9158539bd9ee03.zip
[FIX] lua_scanners - duplicated fail symbol + luastyle
Diffstat (limited to 'src/plugins/lua/external_services.lua')
-rw-r--r--src/plugins/lua/external_services.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index fb7aef709..8e101ab9a 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -112,22 +112,22 @@ end
local function add_scanner_rule(sym, opts)
- if not opts['type'] then
+ if not opts.type then
rspamd_logger.errx(rspamd_config, 'unknown type for external scanner rule %s', sym)
return nil
end
- if not opts['symbol'] then opts['symbol'] = sym:upper() end
- local cfg = lua_scanners[opts['type']]
+ if not opts.symbol then opts.symbol = sym:upper() end
+ local cfg = lua_scanners[opts.type]
if not cfg then
rspamd_logger.errx(rspamd_config, 'unknown external scanner type: %s',
- opts['type'])
+ opts.type)
return nil
end
- if not opts['symbol_fail'] then
- opts['symbol_fail'] = string.upper(opts['type']) .. '_FAIL'
+ if not opts.symbol_fail then
+ opts.symbol_fail = opts.symbol .. '_FAIL'
end
local rule = cfg.configure(opts)
@@ -137,7 +137,7 @@ local function add_scanner_rule(sym, opts)
if not rule then
rspamd_logger.errx(rspamd_config, 'cannot configure %s for %s',
- opts['type'], opts['symbol'])
+ opts.type, opts.symbol)
return nil
end
@@ -153,8 +153,8 @@ local function add_scanner_rule(sym, opts)
rule.mime_parts_filter_ext = common.create_regex_table(opts.mime_parts_filter_ext or {})
- if opts['whitelist'] then
- rule['whitelist'] = rspamd_config:add_hash_map(opts['whitelist'])
+ if opts.whitelist then
+ rule.whitelist = rspamd_config:add_hash_map(opts.whitelist)
end
return function(task)