]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] URL reputation: support terse configuration for ignore_surbl
authorAndrew Lewis <nerf@judo.za.org>
Fri, 3 Feb 2017 15:37:08 +0000 (17:37 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 3 Feb 2017 15:37:35 +0000 (17:37 +0200)
src/plugins/lua/url_reputation.lua

index 952093a62e2e7a6ec91015d90f46dfdb4f743539..17249d088345c72acfd2cf6ef58e86c48b959289 100644 (file)
@@ -592,7 +592,20 @@ if not redis_params then
   return
 end
 for k, v in pairs(opts) do
-  settings[k] = v
+  if k == 'ignore_surbl' then
+    if type(v) == 'table' then
+      if next(v) ~= 1 then
+        settings[k] = v
+      else
+        settings[k] = {}
+        for _, n in ipairs(v) do
+          settings[k][n] = true
+        end
+      end
+    end
+  else
+    settings[k] = v
+  end
 end
 if settings.threshold < 1 then
   rspamd_logger.errx(rspamd_config, 'threshold should be >= 1, disabling module')