From: Carsten Rosenberg Date: Fri, 28 Sep 2018 14:49:11 +0000 (+0200) Subject: [Minor] DCC - add workaround for old host and port settings X-Git-Tag: 1.8.1~135^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F2547%2Fhead;p=rspamd.git [Minor] DCC - add workaround for old host and port settings --- 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,