]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] KAS: add source ip information
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 1 Feb 2024 13:20:36 +0000 (13:20 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 1 Feb 2024 13:20:36 +0000 (13:20 +0000)
lualib/lua_scanners/kaspersky_se.lua

index 5e0f2eaad30327282d58aecdf4bac035e5cee976..bd0a01ffac82fee769ddb13bdd98bb58997b6344 100644 (file)
@@ -118,6 +118,11 @@ local function kaspersky_se_check(task, content, digest, rule, maybe_part)
       ['X-KAV-Timeout'] = tostring(rule.timeout * 1000),
     }
 
+    local ip = task:get_from_ip()
+    if ip and ip:is_valid() then
+      hdrs['X-KAV-SourceIP'] = tostring(ip)
+    end
+
     if task:has_from() then
       hdrs['X-KAV-ObjectURL'] = string.format('[from:%s]', task:get_from()[1].addr)
     end