From: Vsevolod Stakhov Date: Wed, 27 Mar 2024 15:01:29 +0000 (+0000) Subject: [Feature] Allow adding X-CMAE-Score header X-Git-Tag: 3.9.0~81^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd0be13b203cc4cacd935301f4b897f0eef7a3a0;p=rspamd.git [Feature] Allow adding X-CMAE-Score header --- diff --git a/lualib/lua_scanners/cloudmark.lua b/lualib/lua_scanners/cloudmark.lua index b07f238ea..13ebc157d 100644 --- a/lualib/lua_scanners/cloudmark.lua +++ b/lualib/lua_scanners/cloudmark.lua @@ -109,6 +109,7 @@ local function cloudmark_config(opts) symbol_fail = 'CLOUDMARK_FAIL', symbol = 'CLOUDMARK_CHECK', symbol_spam = 'CLOUDMARK_SPAM', + add_score_header = false, -- Add X-CMAE-Score header add_headers = false, -- allow addition of the headers from Cloudmark } @@ -238,6 +239,17 @@ local function parse_cloudmark_reply(task, rule, body) }) end + if rule.add_score_header then + lua_mime.modify_headers(task, { + add = { + ['X-CMAE-Score'] = { + order = 1, + value = tostring(score) + } + } + }) + end + end local function cloudmark_check(task, content, digest, rule, maybe_part)