commit 57e24b6: [Minor] Dkim_signing: Improve sign symbol options

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Sep 28 11:21:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-28 12:14:14 +0100
URL: https://github.com/rspamd/rspamd/commit/57e24b6d83df37e545dab6612982884be2b9f1e3

[Minor] Dkim_signing: Improve sign symbol options

---
 src/plugins/lua/arc.lua          | 13 ++++---------
 src/plugins/lua/dkim_signing.lua |  9 +++++----
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index 9811e4357..e95d0cf9e 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -546,7 +546,8 @@ local function arc_sign_seal(task, params, header)
         'ARC-Seal', cur_arc_seal) }
     }
   })
-  task:insert_result(settings.sign_symbol, 1.0, string.format('i=%d', cur_idx))
+  task:insert_result(settings.sign_symbol, 1.0,
+      string.format('i=%d:%s:%s', cur_idx, params.domain, params.selector))
 end
 
 local function prepare_arc_selector(task, sel)
@@ -623,10 +624,7 @@ local function do_sign(task, sign_params)
 
         local dret, hdr = dkim_sign(task, sign_params)
         if dret then
-          local sret, _ = arc_sign_seal(task, sign_params, hdr)
-          if sret then
-            task:insert_result(settings.sign_symbol, 1.0)
-          end
+          arc_sign_seal(task, sign_params, hdr)
         end
 
       end,
@@ -635,10 +633,7 @@ local function do_sign(task, sign_params)
   else
     local dret, hdr = dkim_sign(task, sign_params)
     if dret then
-      local sret, _ = arc_sign_seal(task, sign_params, hdr)
-      if sret then
-        task:insert_result(settings.sign_symbol, 1.0)
-      end
+      arc_sign_seal(task, sign_params, hdr)
     end
   end
 end
diff --git a/src/plugins/lua/dkim_signing.lua b/src/plugins/lua/dkim_signing.lua
index cfb8d8fe2..e01d09791 100644
--- a/src/plugins/lua/dkim_signing.lua
+++ b/src/plugins/lua/dkim_signing.lua
@@ -53,7 +53,7 @@ local N = 'dkim_signing'
 local redis_params
 local sign_func = rspamd_plugins.dkim.sign
 
-local function insert_sign_results(task, ret, hdr)
+local function insert_sign_results(task, ret, hdr, dkim_params)
   if settings.use_milter_headers then
     task:set_milter_reply({
       add_headers = {
@@ -62,7 +62,8 @@ local function insert_sign_results(task, ret, hdr)
     })
   end
   if ret then
-    task:insert_result(settings.symbol, 1.0)
+    task:insert_result(settings.symbol, 1.0, string.format('%s:%s',
+        dkim_params.domain, dkim_params.selector))
   end
 end
 
@@ -89,13 +90,13 @@ local function do_sign(task, p)
         end
 
         local sret, hdr = sign_func(task, p)
-        insert_sign_results(task, sret, hdr)
+        insert_sign_results(task, sret, hdr, p)
       end,
       forced = true
     })
   else
     local sret, hdr = sign_func(task, p)
-    insert_sign_results(task, sret, hdr)
+    insert_sign_results(task, sret, hdr, p)
   end
 end
 


More information about the Commits mailing list