aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-03-27 15:01:29 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-03-27 15:01:29 +0000
commitcd0be13b203cc4cacd935301f4b897f0eef7a3a0 (patch)
tree0870d195cc8c10eec9699a68f9bd75c500d72ea4 /lualib
parent06b3c7350599b99db6ca3f74768b3815aea77078 (diff)
downloadrspamd-cd0be13b203cc4cacd935301f4b897f0eef7a3a0.tar.gz
rspamd-cd0be13b203cc4cacd935301f4b897f0eef7a3a0.zip
[Feature] Allow adding X-CMAE-Score header
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_scanners/cloudmark.lua12
1 files changed, 12 insertions, 0 deletions
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)