]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Fold b= value when doing arc sealing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Oct 2018 15:08:24 +0000 (16:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Oct 2018 15:33:06 +0000 (16:33 +0100)
src/plugins/lua/arc.lua

index e066613e92d5fa739743cae40bf19c6a10660387..d5ee1b5140167f2519bedd5b65a9fe7a195f26fc 100644 (file)
@@ -483,9 +483,15 @@ local function arc_sign_seal(task, params, header)
   sha_ctx:update(s)
   lua_util.debugm(N, task, 'initial update signature with header: %s', s)
 
+  local nl_type = 'crlf'
+  if task:has_flag("milter") then
+    nl_type = "lf"
+  else
+    nl_type = task:get_newlines_type()
+  end
   local sig = rspamd_rsa.sign_memory(privkey, sha_ctx:bin())
   cur_arc_seal = string.format('%s%s', cur_arc_seal,
-    sig:base64())
+    sig:base64(70, nl_type))
 
   task:set_milter_reply({
     add_headers = {