summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/once_received.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-28 12:59:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-28 12:59:13 +0100
commit2830e7e3eaa30f68d4556cbf4f4e489a00547368 (patch)
tree84334b5597069530f4f866c0f67f5a75d60359c2 /src/plugins/lua/once_received.lua
parent5645cc20de577a60111b42ac15a8c931391307fc (diff)
downloadrspamd-2830e7e3eaa30f68d4556cbf4f4e489a00547368.tar.gz
rspamd-2830e7e3eaa30f68d4556cbf4f4e489a00547368.zip
Fix lua plugins.
Diffstat (limited to 'src/plugins/lua/once_received.lua')
-rw-r--r--src/plugins/lua/once_received.lua21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua
index 80ef8cf29..7cbdacf50 100644
--- a/src/plugins/lua/once_received.lua
+++ b/src/plugins/lua/once_received.lua
@@ -124,31 +124,28 @@ end
-- Configuration
local opts = rspamd_config:get_all_opt('once_received')
if opts then
- if opts['symbol'] then
- local symbol = opts['symbol']
+ if opts['symbol'] then
+ local symbol = opts['symbol']
- for n,v in pairs(opts) do
+ local id = rspamd_config:register_symbol(symbol, 1.0, check_quantity_received)
+
+ for n,v in pairs(opts) do
if n == 'symbol_strict' then
symbol_strict = v
- if type(rspamd_config.get_api_version) ~= 'nil' then
- rspamd_config:register_virtual_symbol(symbol_strict, 1.0)
- end
+ rspamd_config:register_virtual_symbol(symbol_strict, 1.0, id)
elseif n == 'bad_host' then
if type(v) == 'string' then
- bad_hosts[1] = v
+ bad_hosts[1] = v
else
bad_hosts = v
end
elseif n == 'good_host' then
if type(v) == 'string' then
- good_hosts[1] = v
+ good_hosts[1] = v
else
good_hosts = v
end
- end
end
-
- -- Register symbol's callback
- rspamd_config:register_symbol(symbol, 1.0, check_quantity_received)
+ end
end
end