From: Andrew Lewis Date: Thu, 22 Jun 2017 11:06:32 +0000 (+0200) Subject: [Fix] DKIM sign tools: edge-cases around use_esld X-Git-Tag: 1.6.2~87 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a18f713ce121be9d4fd55a6578eab1cc8930316b;p=rspamd.git [Fix] DKIM sign tools: edge-cases around use_esld --- diff --git a/lualib/dkim_sign_tools.lua b/lualib/dkim_sign_tools.lua index 46039639a..7c49aef1e 100644 --- a/lualib/dkim_sign_tools.lua +++ b/lualib/dkim_sign_tools.lua @@ -60,12 +60,12 @@ local function prepare_dkim_signing(N, task, settings) local edom = ((efrom or E)[1] or E).domain local udom = string.match(auser or '', '.*@(.*)') - local function get_dkim_domain(type) - if settings[type] == 'header' then + local function get_dkim_domain(dtype) + if settings[dtype] == 'header' then return hdom - elseif settings[type] == 'envelope' then + elseif settings[dtype] == 'envelope' then return edom - elseif settings[type] == 'auth' then + elseif settings[dtype] == 'auth' then return udom end end @@ -92,16 +92,16 @@ local function prepare_dkim_signing(N, task, settings) rspamd_logger.debugm(N, task, 'could not extract dkim domain') return false,{} else - rspamd_logger.debugm(N, task, 'use domain(%s) for sugnature: %s', + rspamd_logger.debugm(N, task, 'use domain(%s) for signature: %s', settings.use_domain, dkim_domain) end if settings.use_esld then dkim_domain = rspamd_util.get_tld(dkim_domain) - - if settings.use_domain == 'envelope' and hdom then + if hdom then hdom = rspamd_util.get_tld(hdom) - elseif settings.use_domain == 'header' and edom then + end + if edom then edom = rspamd_util.get_tld(edom) end end @@ -173,4 +173,4 @@ end exports.prepare_dkim_signing = prepare_dkim_signing -return exports \ No newline at end of file +return exports