]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Feature] milter_headers: support not removing headers
authorAndrew Lewis <nerf@judo.za.org>
Tue, 4 Jun 2024 09:38:46 +0000 (11:38 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 4 Jun 2024 09:38:46 +0000 (11:38 +0200)
lualib/lua_mime.lua

index 0f5aa75c0a359c49ef1e595590e342c7f813574c..ea6bf5125cb2fb2967a6a1e7b947ad5cfa11655f 100644 (file)
@@ -582,8 +582,11 @@ exports.modify_headers = function(task, hdr_alterations, mode)
       hdr_flattened[hname].remove = {}
     end
     local remove_tbl = hdr_flattened[hname].remove
-    if type(hdr) == 'number' then
+    local t_hdr = type(hdr)
+    if t_hdr == 'number' then
       table.insert(remove_tbl, hdr)
+    elseif t_hdr == 'userdata' then
+      hdr_alterations.remove[hname] = nil
     else
       for _, num in ipairs(hdr) do
         table.insert(remove_tbl, num)