This reverts commit
f552edd887794a5086dcf93d36f8f82d83553196.
Conflicts:
src/plugins/lua/antivirus.lua
src/plugins/lua/asn.lua
src/plugins/lua/dcc.lua
src/plugins/lua/dmarc.lua
src/plugins/lua/emails.lua
src/plugins/lua/forged_recipients.lua
src/plugins/lua/greylist.lua
src/plugins/lua/hfilter.lua
src/plugins/lua/ip_score.lua
src/plugins/lua/maillist.lua
src/plugins/lua/mime_types.lua
src/plugins/lua/multimap.lua
src/plugins/lua/once_received.lua
src/plugins/lua/ratelimit.lua
src/plugins/lua/rbl.lua
src/plugins/lua/replies.lua
src/plugins/lua/rspamd_update.lua
src/plugins/lua/trie.lua
src/plugins/lua/whitelist.lua
-- Registration
local opts = rspamd_config:get_all_opt('antivirus')
if opts and type(opts) == 'table' then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
redis_params = rspamd_parse_redis_server('antivirus')
for k, m in pairs(opts) do
if type(m) == 'table' and m['type'] then
local configure_asn_module = function()
local opts = rspamd_config:get_all_opt('asn')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for k,v in pairs(opts) do
options[k] = v
end
-- Configuration
if opts and opts['host'] then
- if opts['enabled'] == false then
- logger.infox(rspamd_config, 'module is disabled')
- return
- end
rspamd_config:register_symbol({
name = symbol_bulk,
callback = check_dcc
return
end
-if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
-end
-
if opts['symbols'] then
for k,_ in pairs(dmarc_symbols) do
if opts['symbols'][k] then
local opts = rspamd_config:get_all_opt('emails', 'rule')
if opts and type(opts) == 'table' then
- if opts['enabled'] == false then
- logger.infox(rspamd_config, 'module is disabled')
- return
- end
local r = opts['rule']
if r then
local use_settings = false
local opts = rspamd_config:get_all_opt("fann_scores")
if not (opts and type(opts) == 'table') then
- rspamd_logger.infox('Module is unconfigured')
- return
-elseif opts['enabled'] == false then
- rspamd_logger.info('Module is disabled')
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
return
end
-- Configuration
local opts = rspamd_config:get_all_opt('forged_recipients')
if opts then
- if opts['enabled'] == false then
- logger.infox(rspamd_config, 'Module is disabled')
- return
- end
if opts['symbol_rcpt'] or opts['symbol_sender'] then
local id = rspamd_config:register_symbol({
callback = check_forged_headers,
local opts = rspamd_config:get_all_opt('greylist')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
if opts['whitelisted_ip'] then
whitelisted_ip = rspamd_config:add_radix_map(opts['whitelisted_ip'],
'Greylist whitelist ip map')
local opts = rspamd_config:get_all_opt('hfilter')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for k,v in pairs(opts) do
config[k] = v
end
local configure_ip_score_module = function()
local opts = rspamd_config:get_all_opt('ip_score')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for k,v in pairs(opts) do
options[k] = v
end
-- Configuration
local opts = rspamd_config:get_all_opt('maillist')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
if opts['symbol'] then
symbol = opts['symbol']
rspamd_config:register_symbol({
local opts = rspamd_config:get_all_opt('mime_types')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for k,v in pairs(opts) do
settings[k] = v
end
-- Registration
local opts = rspamd_config:get_all_opt('multimap')
if opts and type(opts) == 'table' then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
redis_params = rspamd_parse_redis_server('multimap')
for k,m in pairs(opts) do
if type(m) == 'table' and m['type'] then
-- Configuration
local opts = rspamd_config:get_all_opt('once_received')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
if opts['symbol'] then
local symbol = opts['symbol']
local util = require "rspamd_util"
local opts = rspamd_config:get_all_opt('phishing')
if not (opts and type(opts) == 'table') then
- rspamd_logger.info('Module is unconfigured')
- return
-elseif opts['enabled'] == false then
- rspamd_logger.info('Module is disabled')
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
return
end
end
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- end
if opts['symbol'] then
symbol = opts['symbol']
-- Register symbol's callback
local opts = rspamd_config:get_all_opt('ratelimit')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
local rates = opts['limit']
if rates and type(rates) == 'table' then
fun.each(parse_limit, rates)
-- Configuration
local opts = rspamd_config:get_all_opt('rbl')
if not (opts and type(opts) == 'table') then
- rspamd_logger.info('Module is unconfigured')
-elseif opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
return
end
end
local opts = rspamd_config:get_all_opt('replies')
+if not (opts and type(opts) == 'table') then
+ rspamd_logger.infox(rspamd_config, 'module is unconfigured')
+ return
+end
if opts then
- if not (opts and type(opts) == 'table') then
- rspamd_logger.infox(rspamd_config, 'module is unconfigured')
- return
- elseif opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
redis_params = rspamd_parse_redis_server('replies')
if not redis_params then
rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
-- Configuration part
local section = rspamd_config:get_all_opt("rspamd_update")
if section then
- if section['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
local trusted_key
each(function(k, elt)
if k == 'priority' then
end
end, maps)
else
- rspamd_logger.infox('Module is unconfigured')
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
end
local rspamd_logger = require "rspamd_logger"
local set_section = rspamd_config:get_all_opt("settings")
if not (set_section and type(set_section) == 'table') then
- rspamd_logger.infox('Module is unconfigured')
-elseif set_section['enabled'] == false then
- rspamd_logger.infox('Module is disabled')
- return
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
end
local settings = {
local func_cache = {}
local section = rspamd_config:get_all_opt("spamassassin")
if not (section and type(section) == 'table') then
- rspamd_logger.info('Module is unconfigured')
-elseif section['enabled'] == false then
- rspamd_logger.info('Module is disabled')
- return
+ rspamd_logger.infox(rspamd_config, 'Module is unconfigured')
end
-- Minimum score to treat symbols as meta
local opts = rspamd_config:get_all_opt("trie")
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for sym, opt in pairs(opts) do
process_trie_conf(sym, opt)
end
end
end
else
- rspamd_logger.info("Module is unconfigured")
+ rspamd_logger.infox(rspamd_config, "Module is unconfigured")
end
local configure_whitelist_module = function()
local opts = rspamd_config:get_all_opt('whitelist')
if opts then
- if opts['enabled'] == false then
- rspamd_logger.infox(rspamd_config, 'module is disabled')
- return
- end
for k,v in pairs(opts) do
options[k] = v
end