]> source.dussan.org Git - rspamd.git/commitdiff
Emails and multimap configuration fixes.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Nov 2013 00:29:31 +0000 (00:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Nov 2013 00:29:31 +0000 (00:29 +0000)
src/plugins/lua/emails.lua
src/plugins/lua/multimap.lua

index 0e7705c5faccddd1b1b3b3be63d0692d9c5357e2..8b4ba5970232d5230810c00ede0b742f867b1f96 100644 (file)
@@ -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
index 33ad35a2c01e64f6a0165b4b7690a4bea8b4b4ed..f3d3ef2054e22c4c92cb0aabe0aaf08af39d3b69 100644 (file)
@@ -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