瀏覽代碼

[Project] Encourage dependencies registration by name only

tags/1.7.1
Vsevolod Stakhov 6 年之前
父節點
當前提交
d54cddeeee

+ 3
- 3
src/plugins/lua/arc.lua 查看文件

@@ -341,8 +341,8 @@ rspamd_config:register_symbol({
group = 'policies',
})

rspamd_config:register_dependency(id, symbols['spf_allow_symbol'])
rspamd_config:register_dependency(id, symbols['dkim_allow_symbol'])
rspamd_config:register_dependency('ARC_CALLBACK', symbols['spf_allow_symbol'])
rspamd_config:register_dependency('ARC_CALLBACK', symbols['dkim_allow_symbol'])

local function arc_sign_seal(task, params, header)
local fold_type = "crlf"
@@ -565,4 +565,4 @@ id = rspamd_config:register_symbol({
})

-- Do not sign unless valid
rspamd_config:register_dependency(id, 'ARC_CALLBACK')
rspamd_config:register_dependency(settings['sign_symbol'], 'ARC_CALLBACK')

+ 2
- 2
src/plugins/lua/dmarc.lua 查看文件

@@ -1260,6 +1260,6 @@ rspamd_config:register_symbol({
type = 'virtual'
})

rspamd_config:register_dependency(id, symbols['spf_allow_symbol'])
rspamd_config:register_dependency(id, symbols['dkim_allow_symbol'])
rspamd_config:register_dependency('DMARC_CALLBACK', symbols['spf_allow_symbol'])
rspamd_config:register_dependency('DMARC_CALLBACK', symbols['dkim_allow_symbol'])


+ 2
- 2
src/plugins/lua/force_actions.lua 查看文件

@@ -121,7 +121,7 @@ local function configure_module()
flags = 'empty',
})
for _, a in ipairs(atoms) do
rspamd_config:register_dependency(id, a)
rspamd_config:register_dependency(name, a)
end
rspamd_logger.infox(rspamd_config, 'Registered symbol %1 <%2> with dependencies [%3]', name, expr, table.concat(atoms, ','))
end
@@ -155,7 +155,7 @@ local function configure_module()
local id = rspamd_config:register_symbol(t)
if t.type == 'normal' then
for _, a in ipairs(atoms) do
rspamd_config:register_dependency(id, a)
rspamd_config:register_dependency(t.name, a)
end
rspamd_logger.infox(rspamd_config, 'Registered symbol %1 <%2> with dependencies [%3]', name, expr, table.concat(atoms, ','))
else

+ 1
- 1
src/plugins/lua/mid.lua 查看文件

@@ -96,7 +96,7 @@ if opts then
rspamd_config:add_composite(settings['csymbol_missing_mid_allowed'],
settings['symbol_known_no_mid'] .. ' & ' .. settings['symbol_missing_mid'])

rspamd_config:register_dependency(id, settings['symbol_dkim_allow'])
rspamd_config:register_dependency('KNOWN_MID_CALLBACK', settings['symbol_dkim_allow'])
else
rspamd_logger.infox(rspamd_config, 'source is not specified, disabling module')
lua_util.disable_module(N, "config")

+ 1
- 1
src/plugins/lua/ratelimit.lua 查看文件

@@ -725,7 +725,7 @@ if opts then
end
local id = rspamd_config:register_symbol(s)
if use_ip_score then
rspamd_config:register_dependency(id, 'IP_SCORE')
rspamd_config:register_dependency(s.name, 'IP_SCORE')
end
for _, v in pairs(custom_keywords) do
if type(v) == 'table' and type(v['init']) == 'function' then

+ 2
- 1
src/plugins/lua/rbl.lua 查看文件

@@ -527,6 +527,7 @@ local need_dkim = false
local id = rspamd_config:register_symbol({
type = 'callback',
callback = rbl_cb,
name = 'RBL_CALLBACK',
flags = 'empty,nice'
})

@@ -652,5 +653,5 @@ for _, w in pairs(white_symbols) do
end
end
if need_dkim then
rspamd_config:register_dependency(id, symbols['dkim_allow_symbol'])
rspamd_config:register_dependency('RBL_CALLBACK', symbols['dkim_allow_symbol'])
end

+ 1
- 1
src/plugins/lua/reputation.lua 查看文件

@@ -998,7 +998,7 @@ local function parse_rule(name, tbl)

if rule.selector.dependencies then
fun.each(function(d)
rspamd_config:register_dependency(id, d)
rspamd_config:register_dependency(symbol, d)
end, rule.selector.dependencies)
end


+ 5
- 5
src/plugins/lua/whitelist.lua 查看文件

@@ -264,21 +264,21 @@ local configure_whitelist_module = function()
local spf_dep = false
local dkim_dep = false
if rule['valid_spf'] then
rspamd_config:register_dependency(id, options['spf_allow_symbol'])
rspamd_config:register_dependency(symbol, options['spf_allow_symbol'])
spf_dep = true
end
if rule['valid_dkim'] then
rspamd_config:register_dependency(id, options['dkim_allow_symbol'])
rspamd_config:register_dependency(symbol, options['dkim_allow_symbol'])
dkim_dep = true
end
if rule['valid_dmarc'] then
if not spf_dep then
rspamd_config:register_dependency(id, options['spf_allow_symbol'])
rspamd_config:register_dependency(symbol, options['spf_allow_symbol'])
end
if not dkim_dep then
rspamd_config:register_dependency(id, options['dkim_allow_symbol'])
rspamd_config:register_dependency(symbol, options['dkim_allow_symbol'])
end
rspamd_config:register_dependency(id, 'DMARC_CALLBACK')
rspamd_config:register_dependency(symbol, 'DMARC_CALLBACK')
end

if rule['score'] then

Loading…
取消
儲存