Expect Symbol With Exact Options OPTION_ORDER one two three 4 5 a
Expect Symbol With Exact Options TBL_OPTION_ORDER one two three 4 5 a
+Remove Result
+ Scan File ${MESSAGE} Settings={symbols_enabled = [REMOVE_RESULT_EXPECTED, REMOVE_RESULT_UNEXPECTED]}
+ Expect Symbol REMOVE_RESULT_EXPECTED
+ Do Not Expect Symbol REMOVE_RESULT_UNEXPECTED
+
Rule conditions
Scan File ${MESSAGE} Settings={symbols_enabled = [ANY_A]}
Expect Symbol With Option ANY_A hello3
lua = "{= env.TESTDIR =}/lua/maps_kv.lua"
lua = "{= env.TESTDIR =}/lua/option_order.lua"
lua = "{= env.TESTDIR =}/lua/recipients.lua"
+lua = "{= env.TESTDIR =}/lua/remove_result.lua"
lua = "{= env.TESTDIR =}/lua/tlds.lua"
# 104_get_from
--- /dev/null
+local id = rspamd_config:register_symbol({
+ name = 'REMOVE_RESULT_CB',
+ callback = function(task)
+ task:insert_result('REMOVE_RESULT_UNEXPECTED', 1.0, 'ohno')
+ end,
+ type = 'callback',
+})
+
+rspamd_config:register_symbol({
+ name = 'REMOVE_RESULT_UNEXPECTED',
+ type = 'virtual',
+ score = 0.1,
+ group = 'remove_result_test',
+ parent = id,
+})
+
+rspamd_config:register_symbol({
+ name = 'REMOVE_RESULT_EXPECTED',
+ callback = function(task)
+ return task:remove_result('REMOVE_RESULT_UNEXPECTED') and true or false
+ end,
+ type = 'normal',
+ score = 0.1,
+})
+
+rspamd_config:register_dependency('REMOVE_RESULT_EXPECTED', 'REMOVE_RESULT_UNEXPECTED')