if not params then params = {tostring(mult)};
end
- if rule.config.split_symbols then
+ if rule.selector.config.split_symbols then
if mult >= 0 then
task:insert_result(rule.symbol .. '_SPAM', mult, params)
else
local s = task:get_symbol(sym)[1]
return s.score
end
- if rule.config.split_symbols then
+ if rule.selector.config.split_symbols then
local spam_sym = rule.symbol .. '_SPAM'
local ham_sym = rule.symbol .. '_HAM'
rule.config.whitelist, N)
end
- local symbol = name
+ local symbol = rule.selector.config.symbol or name
if tbl.symbol then
symbol = tbl.symbol
end
end
if rule.enabled then
- rspamd_logger.infox(rspamd_config, 'Enable %s (%s backend) rule for symbol %s',
- sel_type, bk_type, rule.symbol)
+ rspamd_logger.infox(rspamd_config, 'Enable %s (%s backend) rule for symbol %s (split symbols: %s)',
+ sel_type, bk_type, rule.symbol,
+ rule.selector.config.split_symbols)
end
end)
-- We now generate symbol for checking
local id = rspamd_config:register_symbol{
- name = symbol,
+ name = rule.symbol,
type = 'normal',
callback = callback_gen(reputation_filter_cb, rule),
}
- if rule.config.split_symbols then
+ if rule.selector.config.split_symbols then
rspamd_config:register_symbol{
- name = symbol .. '_HAM',
+ name = rule.symbol .. '_HAM',
type = 'virtual',
parent = id,
}
rspamd_config:register_symbol{
- name = symbol .. '_SPAM',
+ name = rule.symbol .. '_SPAM',
type = 'virtual',
parent = id,
}
if rule.selector.postfilter then
-- Also register a postfilter
rspamd_config:register_symbol{
- name = symbol .. '_POST',
+ name = rule.symbol .. '_POST',
type = 'postfilter,nostat',
callback = callback_gen(reputation_postfilter_cb, rule),
}
if rule.selector.idempotent then
-- Has also idempotent component (e.g. saving data to the backend)
rspamd_config:register_symbol{
- name = symbol .. '_IDEMPOTENT',
+ name = rule.symbol .. '_IDEMPOTENT',
type = 'idempotent',
callback = callback_gen(reputation_idempotent_cb, rule),
}