summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-11-11 18:48:34 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-11-11 18:48:34 +0300
commit06496123199f364065fa1e75bd4cd9d89304070d (patch)
treed97d0d12588cad5b6386937b1bf1fa32b5f239bf /src/plugins
parent51e97ee24d8178c85002255af4eb920324946ff2 (diff)
downloadrspamd-06496123199f364065fa1e75bd4cd9d89304070d.tar.gz
rspamd-06496123199f364065fa1e75bd4cd9d89304070d.zip
* Add right way to pass config params with common names to lua scripts
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/once_received.lua4
-rw-r--r--src/plugins/lua/received_rbl.lua15
2 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua
index 3840eb0b0..bf8e31462 100644
--- a/src/plugins/lua/once_received.lua
+++ b/src/plugins/lua/once_received.lua
@@ -51,9 +51,9 @@ if opts then
if n == 'symbol_strict' then
symbol_strict = v
elseif n == 'bad_host' then
- table.insert(bad_hosts, string.lower(v))
+ bad_hosts = v
elseif n == 'good_host' then
- table.insert(good_hosts, string.lower(v))
+ good_hosts = v
elseif n == 'metric' then
metric = v
end
diff --git a/src/plugins/lua/received_rbl.lua b/src/plugins/lua/received_rbl.lua
index 1e0f7d4d6..045b56e7f 100644
--- a/src/plugins/lua/received_rbl.lua
+++ b/src/plugins/lua/received_rbl.lua
@@ -38,14 +38,13 @@ local opts = rspamd_config:get_all_opt('received_rbl')
if opts then
if opts['symbol'] then
symbol = opts['symbol']
-
- for n,v in pairs(opts) do
- if n == 'rbl' then
- table.insert(rbls, v)
- elseif n == 'metric' then
- metric = v
- end
- end
+
+ if opts['metric'] then
+ metric = opts['metric']
+ end
+ if opts['rbl'] then
+ rbls = opts['rbl']
+ end
-- Register symbol's callback
local m = rspamd_config:get_metric(metric)
m:register_symbol(symbol, 1.0, 'received_cb')