From: Vsevolod Stakhov Date: Tue, 2 Aug 2022 20:17:20 +0000 (+0100) Subject: [Minor] Consider subject when checking hash function input length X-Git-Tag: 3.3~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=05c186a485f9b07680f6cb1d0e44039a37a400bf;p=rspamd.git [Minor] Consider subject when checking hash function input length --- diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua index ce4ac55ee..332e828ac 100644 --- a/lualib/lua_fuzzy.lua +++ b/lualib/lua_fuzzy.lua @@ -131,6 +131,13 @@ local function check_length(task, part, rule) -- However, in the case of empty parts this method returns `nil`, so extra -- sanity check is required. bytes = #(part:get_text():get_content_oneline() or '') + + -- Short hashing algorithm also use subject unless explicitly denied + if not rule.no_subject then + local subject = task:get_subject() or '' + bytes = bytes + #subject + end + if rule.text_multiplier then adjusted_bytes = bytes * rule.text_multiplier end