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

index d8b36d030b5014840a8cf5f00f184de4f2465d24..bc3d90be7b8f08eac61fe4a5a711cafcc55d3c6c 100644 (file)
@@ -22,6 +22,7 @@ local lua_redis = require "lua_redis"
 local ucl = require "ucl"
 local lua_mime = require "lua_mime"
 local rspamd_http = require "rspamd_http"
+local rspamd_util = require "rspamd_util"
 
 local settings = {
   helper_url = "http://127.0.0.1:3030",
@@ -108,9 +109,15 @@ local function check_bimi_record(task, rec)
 end
 
 local function insert_bimi_headers(task, domain, bimi_content)
+  local hdr_name = 'BIMI-Indicator'
   lua_mime.modify_headers(task, {
-    remove = {['BIMI-Indicator'] = 0},
-    add = {['BIMI-Indicator'] = {order = 0, value = bimi_content}}
+    remove = {[hdr_name] = 0},
+    add = {
+      [hdr_name] = {
+        order = 0,
+        value = rspamd_util.fold_header(hdr_name, bimi_content)
+      }
+    }
   })
   task:insert_result('BIMI_VALID', 1.0, {domain})
 end