aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-05-21 13:33:25 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-05-21 13:33:48 +0100
commit63e180d7d377c48d9353b8ce385c3fcddf438ffe (patch)
treedf4c9232fa557069eda33a92827893e9de1283b8 /src
parentd55d7fc2c51d32ade8c4e29cab798e6bba754314 (diff)
downloadrspamd-63e180d7d377c48d9353b8ce385c3fcddf438ffe.tar.gz
rspamd-63e180d7d377c48d9353b8ce385c3fcddf438ffe.zip
[Minor] Reputation: Another try to fix dkim reputation
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/reputation.lua7
1 files changed, 6 insertions, 1 deletions
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