]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow adding X-CMAE-Score header
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 27 Mar 2024 15:01:29 +0000 (15:01 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 27 Mar 2024 15:01:29 +0000 (15:01 +0000)
lualib/lua_scanners/cloudmark.lua

index b07f238ea025b7085643077607335b31256821b2..13ebc157dab0e799218a1f8dbf5f5e56dd8fb11a 100644 (file)
@@ -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)