From: Vsevolod Stakhov Date: Tue, 14 Dec 2021 15:54:36 +0000 (+0000) Subject: [Minor] Bimi: Fold header X-Git-Tag: 3.2~165 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=958449c027d3a01e113b92d009bd6ec28bfe71df;p=rspamd.git [Minor] Bimi: Fold header --- diff --git a/src/plugins/lua/bimi.lua b/src/plugins/lua/bimi.lua index d8b36d030..bc3d90be7 100644 --- a/src/plugins/lua/bimi.lua +++ b/src/plugins/lua/bimi.lua @@ -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