From: Vsevolod Stakhov Date: Thu, 9 Nov 2017 08:00:17 +0000 (+0000) Subject: [Fix] Remove extra noise from dkim and arc signing X-Git-Tag: 1.7.0~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f619e4eeb134bde127dbe5f89de7e669233d1206;p=thirdparty%2Frspamd.git [Fix] Remove extra noise from dkim and arc signing --- diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index 343f9aed4a..53765917eb 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -526,6 +526,10 @@ local function arc_signing_cb(task) else if (p.key and p.selector) then p.key = lua_util.template(p.key, {domain = p.domain, selector = p.selector}) + if not rspamd_util.file_exists(p.key) then + rspamd_logger.debugm(N, task, 'file %s does not exists', p.key) + return false + end local dret, hdr = dkim_sign(task, p) if dret then return arc_sign_seal(task, p, hdr) diff --git a/src/plugins/lua/dkim_signing.lua b/src/plugins/lua/dkim_signing.lua index edb4db2f62..4b871e472c 100644 --- a/src/plugins/lua/dkim_signing.lua +++ b/src/plugins/lua/dkim_signing.lua @@ -113,6 +113,10 @@ local function dkim_signing_cb(task) else if (p.key and p.selector) then p.key = lutil.template(p.key, {domain = p.domain, selector = p.selector}) + if not rspamd_util.file_exists(p.key) then + rspamd_logger.debugm(N, task, 'file %s does not exists', p.key) + return false + end local sret, _ = sign_func(task, p) return sret else