From 6c4c2662c2c44222d4205db839d7f2d1566b9a78 Mon Sep 17 00:00:00 2001 From: Carsten Rosenberg Date: Fri, 28 Sep 2018 16:49:11 +0200 Subject: [PATCH] [Minor] DCC - add workaround for old host and port settings --- src/plugins/lua/dcc.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/lua/dcc.lua b/src/plugins/lua/dcc.lua index 30584e1e0..311dc608e 100644 --- a/src/plugins/lua/dcc.lua +++ b/src/plugins/lua/dcc.lua @@ -180,6 +180,20 @@ local function check_dcc (task) end -- Configuration + +-- WORKAROUND for deprecated host and port settings +if opts['host'] ~= nil and opts['port'] ~= nil then + opts['servers'] = opts['host'] .. ':' .. opts['port'] + rspamd_logger.warnx(rspamd_config, 'Using host and port parameters is deprecated. '.. + 'Please use servers = "%s:%s"; instead', opts['host'], opts['port']) +end +if opts['host'] ~= nil and not opts['port'] then + opts['socket'] = opts['host'] + rspamd_logger.warnx(rspamd_config, 'Using host parameters is deprecated. '.. + 'Please use socket = "%s"; instead', opts['host']) +end +-- WORKAROUND for deprecated host and port settings + if opts and ( opts['servers'] or opts['socket'] ) then rspamd_config:register_symbol({ name = symbol_bulk, -- 2.39.5