]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow regexps in the emails maps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 27 Jul 2016 12:39:49 +0000 (13:39 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 27 Jul 2016 12:39:49 +0000 (13:39 +0100)
src/plugins/lua/emails.lua

index 232ca26551dfeb31507c7373356625870ee192cb..862d82725930c9c8c57fbcdcc7aaf137c8d17b2c 100644 (file)
@@ -92,7 +92,11 @@ if opts and type(opts) == 'table' then
 
       if rule['map'] then
         rule['name'] = rule['map']
-        rule['map'] = rspamd_config:add_hash_map (rule['name'])
+        rule['map'] = rspamd_config:add_map({
+           url = rule['name'],
+           description = string.format('Emails rule %s', rule['symbol']),
+           type = 'regexp'
+        })
       end
       if not rule['symbol'] or (not rule['map'] and not rule['dnsbl']) then
         logger.errx(rspamd_config, 'incomplete rule')