commit 63e180d: [Minor] Reputation: Another try to fix dkim reputation
Vsevolod Stakhov
vsevolod at rspamd.com
Sat May 21 12:35:03 UTC 2022
Author: Vsevolod Stakhov
Date: 2022-05-21 13:33:25 +0100
URL: https://github.com/rspamd/rspamd/commit/63e180d7d377c48d9353b8ce385c3fcddf438ffe (HEAD -> master)
[Minor] Reputation: Another try to fix dkim reputation
---
src/plugins/lua/reputation.lua | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua
index dd1cfd913..0c8fc1c36 100644
--- a/src/plugins/lua/reputation.lua
+++ b/src/plugins/lua/reputation.lua
@@ -218,8 +218,13 @@ local function dkim_reputation_filter(task, rule)
rep_accepted_abs, rep_rejected_abs)
if rep_accepted_abs > 0 or rep_rejected_abs > 0 then
if rep_accepted_abs > rep_rejected_abs then
- add_symbol_score(task, rule, -(rep_accepted_abs - rep_rejected_abs))
+ -- For accepted reputation we add symbol with just this reputation, either positive or negative
+ local final_rep = rep_accepted
+ if rep_accepted > 1.0 then final_rep = 1.0 end
+ if rep_accepted < -1.0 then final_rep = -1.0 end
+ add_symbol_score(task, rule, final_rep)
else
+ -- For rejected case we use absolute values as it must always be positive
add_symbol_score(task, rule, (rep_rejected_abs - rep_accepted_abs))
end
More information about the Commits
mailing list