]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Use dkim signing callback properly
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 24 May 2017 11:11:57 +0000 (12:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 24 May 2017 11:11:57 +0000 (12:11 +0100)
src/plugins/dkim_check.c
src/plugins/lua/dkim_signing.lua

index b73500ba8dde679f432ca62a134b4db654879858..099d67d99c0843a80cb419520cf1d4437e5680f8 100644 (file)
@@ -590,7 +590,7 @@ lua_dkim_sign_handler (lua_State *L)
         * - key
         */
        if (!rspamd_lua_parse_table_arguments (L, 2, &err,
-                       "key=S;rawkey=V;*domain=S;*selector=S;no_check=B;headers=S",
+                       "key=S;rawkey=V;*domain=S;*selector=S;no_cache=B;headers=S",
                        &key, &rawlen, &rawkey, &domain, &selector, &no_cache, &headers)) {
                msg_err_task ("invalid return value from sign condition: %e",
                                err);
index b76a73acb5da6afc92e41ce9bd2370d72f2b3753..7cd152ba396c6360d3c5b690060518faa100324b 100644 (file)
@@ -45,6 +45,7 @@ local settings = {
 local E = {}
 local N = 'dkim_signing'
 local redis_params
+local sign_func = rspamd_plugins.dkim.sign
 
 local function simple_template(tmpl, keys)
   local lpeg = require "lpeg"
@@ -195,7 +196,8 @@ local function dkim_signing_cb(task)
             rk, err)
         else
           p.rawkey = data
-          if rspamd_plugins.dkim.sign(task, p) then
+          local ret, _ = sign_func(task, p)
+          if ret then
             task:insert_result(settings.symbol, 1.0)
           end
         end
@@ -242,7 +244,8 @@ local function dkim_signing_cb(task)
   else
     if (p.key and p.selector) then
       p.key = simple_template(p.key, {domain = p.domain, selector = p.selector})
-      return rspamd_plugins.dkim.sign(task, p)
+      local ret, _ = sign_func(task, p)
+      return ret
     else
       rspamd_logger.infox(task, 'key path or dkim selector unconfigured; no signing')
       return false