]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Bimi: Fold huge bimi header
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Dec 2021 16:41:01 +0000 (16:41 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Dec 2021 16:41:01 +0000 (16:41 +0000)
src/plugins/lua/bimi.lua

index bc3d90be7b8f08eac61fe4a5a711cafcc55d3c6c..a2768ea26ef9140ab426ed83cf84ead240cfec7c 100644 (file)
@@ -110,12 +110,16 @@ end
 
 local function insert_bimi_headers(task, domain, bimi_content)
   local hdr_name = 'BIMI-Indicator'
+  -- Re-encode base64...
+  local content = rspamd_util.encode_base64(rspamd_util.decode_base64(bimi_content),
+      73, task:get_newlines_type())
   lua_mime.modify_headers(task, {
     remove = {[hdr_name] = 0},
     add = {
       [hdr_name] = {
         order = 0,
-        value = rspamd_util.fold_header(hdr_name, bimi_content)
+        value = rspamd_util.fold_header(hdr_name, content,
+            task:get_newlines_type())
       }
     }
   })