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.

deps.lua 776B

123456789101112131415161718192021222324252627282930
  1. local cb = function(task)
  2. task:insert_result('TOP', 1.0)
  3. end
  4. local cb_dep1 = function(task)
  5. if task:get_symbol('TOP') then
  6. task:insert_result('DEP1', 1.0)
  7. end
  8. end
  9. local cb_gen = function(num)
  10. local cb_dep = function(task)
  11. if task:get_symbol('DEP' .. tostring(num)) then
  12. task:insert_result('DEP' .. tostring(num + 1), 1.0)
  13. end
  14. end
  15. return cb_dep
  16. end
  17. local id = rspamd_config:register_callback_symbol(1.0, cb)
  18. rspamd_config:register_virtual_symbol('TOP', 1.0, id)
  19. rspamd_config:register_symbol('DEP1', 1.0, cb_dep1)
  20. rspamd_config:register_dependency('DEP1', 'TOP')
  21. for i = 2,10 do
  22. rspamd_config:register_symbol('DEP' .. tostring(i), 1.0, cb_gen(i - 1))
  23. rspamd_config:register_dependency('DEP' .. tostring(i), 'DEP' .. tostring(i - 1))
  24. end