summaryrefslogtreecommitdiffstats
path: root/lualib/lua_cfg_transform.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-31 16:40:52 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-31 16:40:52 +0100
commit935e7918e6066304023c82887e4d07965f1268f2 (patch)
treedf63e87bf8669b2dbe1fc41596a3cd964b7ca412 /lualib/lua_cfg_transform.lua
parent5b1a3846ec7721bc9184c83d83bd75b2c8f0a006 (diff)
downloadrspamd-935e7918e6066304023c82887e4d07965f1268f2.tar.gz
rspamd-935e7918e6066304023c82887e4d07965f1268f2.zip
[Minor] Compat: Allow to use old style sign_condition
Diffstat (limited to 'lualib/lua_cfg_transform.lua')
-rw-r--r--lualib/lua_cfg_transform.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua
index ae05eed59..971a341b4 100644
--- a/lualib/lua_cfg_transform.lua
+++ b/lualib/lua_cfg_transform.lua
@@ -301,8 +301,29 @@ return function(cfg)
end
-- Deal with dkim settings
- if not cfg.dkim then cfg.dkim = {} end
+ if not cfg.dkim then
+ cfg.dkim = {}
+ else
+ if cfg.dkim.sign_condition then
+ -- We have an obsoleted sign condition, so we need to either add dkim_signing and move it
+ -- there or just move sign condition there...
+ if not cfg.dkim_signing then
+ logger.warnx('obsoleted DKIM signing method used, converting it to "dkim_signing" module')
+ cfg.dkim_signing = {
+ sign_condition = cfg.dkim.sign_condition
+ }
+ else
+ if not cfg.dkim_signing.sign_condition then
+ logger.warnx('obsoleted DKIM signing method used, move it to "dkim_signing" module')
+ cfg.dkim_signing.sign_condition = cfg.dkim.sign_condition
+ else
+ logger.warnx('obsoleted DKIM signing method used, ignore it as "dkim_signing" also defines condition!')
+ end
+ end
+ end
+ end
+ -- Again: legacy stuff :(
if not cfg.dkim.sign_headers then
local sec = cfg.dkim_signing
if sec and sec[1] then sec = cfg.dkim_signing[1] end