From: Vsevolod Stakhov Date: Wed, 20 Nov 2013 00:29:31 +0000 (+0000) Subject: Emails and multimap configuration fixes. X-Git-Tag: 0.6.0~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c45b52f62853d8854151693663a59fbabbf475e8;p=rspamd.git Emails and multimap configuration fixes. --- diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua index 0e7705c5f..8b4ba5970 100644 --- a/src/plugins/lua/emails.lua +++ b/src/plugins/lua/emails.lua @@ -88,7 +88,7 @@ local function add_emails_rule(key, obj) dnsbl = nil, map = nil, domain_only = false, - symbol = k + symbol = key } for name,value in pairs(obj) do if name == 'dnsbl' then @@ -100,9 +100,7 @@ local function add_emails_rule(key, obj) elseif name == 'symbol' then newrule['symbol'] = value elseif name == 'domain_only' then - if value == 'yes' or value == 'true' or value == '1' then - newrule['domain_only'] = true - end + newrule['domain_only'] = value else rspamd_logger.err('invalid rule option: '.. name) return nil @@ -138,7 +136,7 @@ if opts then rspamd_logger.err('cannot add rule: "'..k..'"') else if type(rspamd_config.get_api_version) ~= 'nil' then - rspamd_config:register_virtual_symbol(m['symbol'], 1.0) + rspamd_config:register_virtual_symbol(rule['symbol'], 1.0) end end end diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 33ad35a2c..f3d3ef205 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -288,7 +288,7 @@ if opts and type(opts) == 'table' then rspamd_logger.err('cannot add rule: "'..k..'"') else if type(rspamd_config.get_api_version) ~= 'nil' then - rspamd_config:register_virtual_symbol(m['symbol'], 1.0) + rspamd_config:register_virtual_symbol(rule['symbol'], 1.0) end end else @@ -303,5 +303,4 @@ if opts and type(opts) == 'table' then rspamd_config:register_callback_symbol('MULTIMAP', 1.0, check_multimap) end end - rspamd_config:register_symbol('MULTIMAP', 1.0, check_multimap) end