From f619e4eeb134bde127dbe5f89de7e669233d1206 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 9 Nov 2017 08:00:17 +0000 Subject: [PATCH] [Fix] Remove extra noise from dkim and arc signing --- src/plugins/lua/arc.lua | 4 ++++ src/plugins/lua/dkim_signing.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index 343f9aed4..53765917e 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 edb4db2f6..4b871e472 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 -- 2.39.5