fann_file = opts['fann_file']
use_settings = opts['use_settings']
rspamd_config:set_metric_symbol(fann_symbol, 3.0, 'Experimental FANN adjustment')
- rspamd_config:register_post_filter(fann_scores_filter)
-
+ rspamd_config:register_symbol({
+ name = fann_symbol,
+ type = 'postfilter',
+ callback = fann_scores_filter
+ })
if opts['train'] then
rspamd_config:add_on_load(function(cfg)
if opts['train']['max_train'] then
if not redis_params then
rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
else
- rspamd_config:register_pre_filter(greylist_check)
- rspamd_config:register_post_filter(greylist_set, 10)
+ rspamd_config:register_symbol({
+ name = 'GREYLIST_SAVE',
+ type = 'postfilter',
+ callback = greylist_set,
+ priority = 10
+ })
+ rspamd_config:register_symbol({
+ name = 'GREYLIST_SAVE',
+ type = 'prefilter',
+ callback = greylist_check,
+ })
end
for k,v in pairs(opts) do
if redis_params then
-- Register ip_score module
if options['asn_provider'] then
- rspamd_config:register_pre_filter(asn_check)
+ rspamd_config:register_symbol({
+ name = 'ASN_CHECK',
+ type = 'prefilter',
+ callback = asn_check,
+ })
end
+ rspamd_config:register_symbol({
+ name = 'IPSCORE_SAVE',
+ type = 'postfilter',
+ callback = ip_score_set,
+ })
rspamd_config:register_symbol({
name = options['symbol'],
callback = ip_score_check
})
- rspamd_config:register_post_filter(ip_score_set)
end
end
if _.any(function(r) return r['prefilter'] end, rules) then
- rspamd_config:register_pre_filter(multimap_prefilter_callback)
+ rspamd_config:register_symbol({
+ type = 'prefilter',
+ name = 'MULTIMAP_PREFILTERS',
+ callback = multimap_prefilter_callback
+ })
end
end
rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
else
if not ratelimit_symbol then
- rspamd_config:register_pre_filter(rate_test)
+ rspamd_config:register_symbol({
+ name = 'RATELIMIT_CHECK',
+ type = 'prefilter',
+ callback = rate_test,
+ })
else
rspamd_config:register_symbol({
name = ratelimit_symbol,
})
end
- rspamd_config:register_post_filter(rate_set)
+ rspamd_config:register_symbol({
+ name = 'RATELIMIT_SET',
+ type = 'postfilter',
+ callback = rate_set,
+ })
end
end
if not redis_params then
rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
else
- rspamd_config:register_pre_filter(replies_check)
- rspamd_config:register_post_filter(replies_set, 10)
+ rspamd_config:register_symbol({
+ name = 'REPLIES_SET',
+ type = 'postfilter',
+ callback = replies_set,
+ priority = 10
+ })
+ rspamd_config:register_symbol({
+ name = 'REPLIES_CHECK',
+ type = 'prefilter',
+ callback = replies_check,
+ })
end
for k,v in pairs(opts) do
process_settings_table(set_section)
end
-rspamd_config:register_pre_filter(check_settings)
+rspamd_config:register_symbol({
+ name = 'SETTINGS_CHECK',
+ type = 'prefilter',
+ callback = check_settings,
+ priority = 10
+})