Ver código fonte

[Fix] Distinguish type from flags in register_symbol

tags/2.6
Vsevolod Stakhov 4 anos atrás
pai
commit
f6722f0534

+ 2
- 2
src/plugins/lua/asn.lua Ver arquivo

@@ -126,10 +126,10 @@ end
if configure_asn_module() then
local id = rspamd_config:register_symbol({
name = 'ASN_CHECK',
type = 'prefilter,nostat',
type = 'prefilter',
callback = asn_check,
priority = 8,
flags = 'empty',
flags = 'empty,nostat',
})
if options['symbol'] then
rspamd_config:register_symbol({

+ 4
- 2
src/plugins/lua/mime_types.lua Ver arquivo

@@ -573,7 +573,8 @@ if opts then
local id = rspamd_config:register_symbol({
name = 'MIME_TYPES_CALLBACK',
callback = check_mime_type,
type = 'callback,nostat',
type = 'callback',
flags = 'nostat',
group = 'mime_types',
})

@@ -633,10 +634,11 @@ if opts then
group = 'mime_types',
})
rspamd_config:register_symbol({
type = 'virtual,nostat',
type = 'virtual',
name = 'MIME_TRACE',
parent = id,
group = 'mime_types',
flags = 'nostat',
score = 0,
})
else

+ 8
- 4
src/plugins/lua/neural.lua Ver arquivo

@@ -1390,7 +1390,8 @@ end

local id = rspamd_config:register_symbol({
name = 'NEURAL_CHECK',
type = 'postfilter,nostat',
type = 'postfilter',
flags = 'nostat',
priority = 6,
callback = ann_scores_filter
})
@@ -1426,7 +1427,8 @@ for k,r in pairs(rules) do
})
rspamd_config:register_symbol({
name = rule_elt.symbol_spam,
type = 'virtual,nostat',
type = 'virtual',
flags = 'nostat',
parent = id
})

@@ -1438,14 +1440,16 @@ for k,r in pairs(rules) do
})
rspamd_config:register_symbol({
name = rule_elt.symbol_ham,
type = 'virtual,nostat',
type = 'virtual',
flags = 'nostat',
parent = id
})
end

rspamd_config:register_symbol({
name = 'NEURAL_LEARN',
type = 'idempotent,nostat,explicit_disable',
type = 'idempotent',
flags = 'nostat,explicit_disable',
priority = 5,
callback = ann_push_vector
})

+ 2
- 2
src/plugins/lua/p0f.lua Ver arquivo

@@ -85,10 +85,10 @@ if rule then

local id = rspamd_config:register_symbol({
name = 'P0F_CHECK',
type = 'prefilter,nostat',
type = 'prefilter',
callback = check_p0f,
priority = 8,
flags = 'empty',
flags = 'empty,nostat',
group = N
})


+ 2
- 2
src/plugins/lua/ratelimit.lua Ver arquivo

@@ -856,11 +856,11 @@ if opts then
lua_util.disable_module(N, "redis")
else
local s = {
type = 'prefilter,nostat',
type = 'prefilter',
name = 'RATELIMIT_CHECK',
priority = 7,
callback = ratelimit_cb,
flags = 'empty',
flags = 'empty,nostat',
}

if settings.symbol then

+ 2
- 1
src/plugins/lua/rbl.lua Ver arquivo

@@ -990,7 +990,8 @@ local function add_rbl(key, rbl, global_opts)

-- Failure symbol
rspamd_config:register_symbol{
type = 'virtual,nostat',
type = 'virtual',
flags = 'nostat',
name = rbl.symbol .. '_FAIL',
parent = id,
score = 0.0,

+ 4
- 2
src/plugins/lua/replies.lua Ver arquivo

@@ -279,8 +279,9 @@ if opts then

local id = rspamd_config:register_symbol({
name = 'REPLIES_CHECK',
type = 'prefilter,nostat',
type = 'prefilter',
callback = replies_check_cookie,
flags = 'nostat',
priority = 10,
group = "replies"
})
@@ -302,7 +303,8 @@ if opts then
})
local id = rspamd_config:register_symbol({
name = 'REPLIES_CHECK',
type = 'prefilter,nostat',
type = 'prefilter',
flags = 'nostat',
callback = replies_check,
priority = 10,
group = "replies"

+ 2
- 1
src/plugins/lua/reputation.lua Ver arquivo

@@ -1197,7 +1197,8 @@ local function parse_rule(name, tbl)
-- Also register a postfilter
rspamd_config:register_symbol{
name = rule.symbol .. '_POST',
type = 'postfilter,nostat',
type = 'postfilter',
flags = 'nostat',
callback = callback_gen(reputation_postfilter_cb, rule),
}
end

+ 2
- 2
src/plugins/lua/settings.lua Ver arquivo

@@ -1149,10 +1149,10 @@ if redis_section then
fun.each(function(id, h)
rspamd_config:register_symbol({
name = 'REDIS_SETTINGS' .. tostring(id),
type = 'prefilter,nostat',
type = 'prefilter',
callback = gen_redis_callback(h, id),
priority = 10,
flags = 'empty',
flags = 'empty,nostat',
})
end, redis_key_handlers)
end

Carregando…
Cancelar
Salvar