mirror of https://github.com/rspamd/rspamd.git
Rapid spam filtering system
https://rspamd.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
708 B
24 lines
708 B
local true_cb_gen = function()
|
|
return function()
|
|
return true
|
|
end
|
|
end
|
|
|
|
local test_weights = { 1, 2, 4, 8, 16 }
|
|
for _, i in ipairs(test_weights) do
|
|
rspamd_config:register_symbol('GR_POSITIVE' .. tostring(i), 1.0, true_cb_gen())
|
|
|
|
if i > 1 then
|
|
local half = math.floor(i / 2)
|
|
rspamd_config:register_dependency('GR_POSITIVE' .. tostring(i), 'GR_POSITIVE' .. tostring(half))
|
|
end
|
|
|
|
rspamd_config:register_symbol('GR_NEGATIVE' .. tostring(i), 1.0, true_cb_gen())
|
|
|
|
if i > 1 then
|
|
local half = math.floor(i / 2)
|
|
rspamd_config:register_dependency('GR_NEGATIVE' .. tostring(i), 'GR_NEGATIVE' .. tostring(half))
|
|
end
|
|
end
|
|
|
|
rspamd_config:register_dependency('GR_NEGATIVE1', 'GR_POSITIVE16')
|