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.

23 lines
708 B

  1. local true_cb_gen = function()
  2. return function()
  3. return true
  4. end
  5. end
  6. local test_weights = { 1, 2, 4, 8, 16 }
  7. for _, i in ipairs(test_weights) do
  8. rspamd_config:register_symbol('GR_POSITIVE' .. tostring(i), 1.0, true_cb_gen())
  9. if i > 1 then
  10. local half = math.floor(i / 2)
  11. rspamd_config:register_dependency('GR_POSITIVE' .. tostring(i), 'GR_POSITIVE' .. tostring(half))
  12. end
  13. rspamd_config:register_symbol('GR_NEGATIVE' .. tostring(i), 1.0, true_cb_gen())
  14. if i > 1 then
  15. local half = math.floor(i / 2)
  16. rspamd_config:register_dependency('GR_NEGATIVE' .. tostring(i), 'GR_NEGATIVE' .. tostring(half))
  17. end
  18. end
  19. rspamd_config:register_dependency('GR_NEGATIVE1', 'GR_POSITIVE16')