Skip to content

Commit

Permalink
[Minor] Remove surbl notice
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Aug 28, 2019
1 parent 61f8601 commit 201a495
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion conf/options.inc
@@ -1,6 +1,6 @@
# Included from top-level .conf file

filters = "chartable,dkim,spf,surbl,regexp,fuzzy_check";
filters = "chartable,dkim,spf,regexp,fuzzy_check";
raw_mode = false;
one_shot = false;
cache_file = "$DBDIR/symbols.cache";
Expand Down
33 changes: 16 additions & 17 deletions lualib/lua_maps.lua
Expand Up @@ -116,12 +116,12 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if type(opt) == 'string' then
opt,mtype = maybe_adjust_type(opt, mtype)
local k = map_hash_key(opt, mtype)
if maps_cache[k] then
local cache_key = map_hash_key(opt, mtype)
if maps_cache[cache_key] then
rspamd_logger.infox(rspamd_config, 'reuse url for %s(%s)',
opt, mtype)
return maps_cache[k]
return maps_cache[cache_key]
end
-- We have a single string, so we treat it as a map
local map = rspamd_config:add_map{
Expand All @@ -132,18 +132,18 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
ret.hash = k
ret.hash = cache_key
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
elseif type(opt) == 'table' then
local k = lua_util.table_digest(opt)
if maps_cache[k] then
local cache_key = lua_util.table_digest(opt)
if maps_cache[cache_key] then
rspamd_logger.infox(rspamd_config, 'reuse url for complex map definition %s: %s',
k:sub(1,8), description)
cache_key:sub(1,8), description)
return maps_cache[k]
return maps_cache[cache_key]
end
if opt[1] then
Expand All @@ -155,7 +155,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
else
Expand All @@ -168,7 +168,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
end
Expand All @@ -183,7 +183,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
else
Expand All @@ -198,7 +198,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
end
Expand All @@ -213,7 +213,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
else
Expand All @@ -225,7 +225,6 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
-- Numeric table
if mtype == 'hash' then
-- Treat as KV pair
local lua_util = require "lua_util"
local pieces = lua_util.str_split(elt, ' ')
if #pieces > 1 then
local key = table.remove(pieces, 1)
Expand All @@ -252,7 +251,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
return nil
end
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
else
-- Empty map, huh?
Expand All @@ -271,7 +270,7 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
if map then
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[k] = ret
maps_cache[cache_key] = ret
return ret
end
end -- opt[1]
Expand Down

0 comments on commit 201a495

Please sign in to comment.