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.

mapreload.lua 605B

1234567891011121314151617181920
  1. local test_map = rspamd_config:add_map ({
  2. url = '${MAP_FILE}',
  3. type = 'set',
  4. })
  5. rspamd_config:register_symbol({
  6. name = 'MAP_SET_HIT_AND_MISS',
  7. score = 1.0,
  8. callback = function()
  9. local has_example = test_map:get_key('example.com')
  10. local has_rspamdtest = test_map:get_key('rspamd-test.com')
  11. if has_example and not has_rspamdtest then
  12. return true, 'example.com'
  13. elseif has_rspamdtest and not has_example then
  14. return true, 'rspamd.com'
  15. else
  16. return true, string.format('invalid: has_example=%s, has_rspamdtest=%s', has_example, has_rspamdtest)
  17. end
  18. end
  19. })