| 1 |
rspamd_config:register_symbol({ |
| 2 |
name = 'SIMPLE_PRE', |
| 3 |
score = 1.0, |
| 4 |
priority = 9, -- after settings |
| 5 |
group = 'a', |
| 6 |
type = 'prefilter', |
| 7 |
callback = function() |
| 8 |
return true, 'Fires always' |
| 9 |
end |
| 10 |
}) |
| 11 |
|
| 12 |
rspamd_config:register_symbol({ |
| 13 |
name = 'SIMPLE_POST', |
| 14 |
score = 1.0, |
| 15 |
type = 'postfilter', |
| 16 |
group = 'c', |
| 17 |
callback = function() |
| 18 |
return true, 'Fires always' |
| 19 |
end |
| 20 |
}) |
| 21 |
|
| 22 |
local id = rspamd_config:register_symbol({ |
| 23 |
name = 'SIMPLE_TEST', |
| 24 |
score = 1.0, |
| 25 |
group = 'b', |
| 26 |
callback = function(task) |
| 27 |
task:insert_result('SIMPLE_VIRTUAL', 1.0) |
| 28 |
task:insert_result('SIMPLE_VIRTUAL1', 1.0) |
| 29 |
return true, 'Fires always' |
| 30 |
end |
| 31 |
}) |
| 32 |
|
| 33 |
rspamd_config:register_symbol({ |
| 34 |
name = 'SIMPLE_VIRTUAL', |
| 35 |
type = 'virtual', |
| 36 |
score = 1.0, |
| 37 |
group = 'vg', |
| 38 |
parent = id, |
| 39 |
}) |
| 40 |
|
| 41 |
rspamd_config:register_symbol({ |
| 42 |
name = 'SIMPLE_VIRTUAL1', |
| 43 |
type = 'virtual', |
| 44 |
forbidden_ids = 'id_virtual,id_virtual_group', |
| 45 |
allowed_ids = 'id_virtual1', |
| 46 |
score = 1.0, |
| 47 |
group = 'vg', |
| 48 |
parent = id, |
| 49 |
}) |
| 50 |
|
| 51 |
id = rspamd_config:register_symbol({ |
| 52 |
name = 'DEP_REAL', |
| 53 |
callback = function(task) |
| 54 |
task:insert_result('DEP_VIRTUAL', 1.0) |
| 55 |
return true |
| 56 |
end, |
| 57 |
score = 1.0, |
| 58 |
}) |
| 59 |
|
| 60 |
rspamd_config:register_symbol({ |
| 61 |
name = 'DEP_VIRTUAL', |
| 62 |
parent = id, |
| 63 |
type = 'virtual', |
| 64 |
allowed_ids = 'id_virtual1', |
| 65 |
score = 1.0, |
| 66 |
}) |
| 67 |
|
| 68 |
rspamd_config:register_dependency('DEP_VIRTUAL', 'EXPLICIT_VIRTUAL1') |