commit 659b274: [Minor] Skip modifying headers for skipped tasks

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Nov 3 20:14:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-03 20:13:32 +0000
URL: https://github.com/rspamd/rspamd/commit/659b274e0f68e8c8f185a34e6df7695b9c095d23 (HEAD -> master)

[Minor] Skip modifying headers for skipped tasks

---
 lualib/lua_mime.lua | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua
index a57c2181e..a09ef84f8 100644
--- a/lualib/lua_mime.lua
+++ b/lualib/lua_mime.lua
@@ -515,6 +515,10 @@ end
 -- Adds/removes headers both internal and in the milter reply
 --]]
 exports.modify_headers = function(task, hdr_alterations)
+  if task:has_flag('skip') then
+    -- Cannot set flags for skipped (and unprocessed) task
+    return
+  end
   local add = hdr_alterations.add or {}
   local remove = hdr_alterations.remove or {}
 


More information about the Commits mailing list