summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/dkim_signing.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-11 11:32:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-11 11:32:43 +0100
commit0e654a69f908ae3abe19663dc192f1dbc45d8ed0 (patch)
treee6802c0328f8a352dbfb1bd5986b66902a9294ba /src/plugins/lua/dkim_signing.lua
parenta028e5973813023f29c740a0b857fa32ce1c51fb (diff)
downloadrspamd-0e654a69f908ae3abe19663dc192f1dbc45d8ed0.tar.gz
rspamd-0e654a69f908ae3abe19663dc192f1dbc45d8ed0.zip
[Feature] Improve error reporting for DKIM key access issues
Diffstat (limited to 'src/plugins/lua/dkim_signing.lua')
-rw-r--r--src/plugins/lua/dkim_signing.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/lua/dkim_signing.lua b/src/plugins/lua/dkim_signing.lua
index 9b8f0a047..5e057cf9e 100644
--- a/src/plugins/lua/dkim_signing.lua
+++ b/src/plugins/lua/dkim_signing.lua
@@ -117,10 +117,16 @@ 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)
+ local exists,err = rspamd_util.file_exists(p.key)
+ if not exists then
+ if err and err == 'No such file or directory' then
+ rspamd_logger.debugm(N, task, 'cannot read key from %s: %s', p.key, err)
+ else
+ rspamd_logger.warnx(N, task, 'cannot read key from %s: %s', p.key, err)
+ end
return false
end
+
local sret, _ = sign_func(task, p)
return sret
else