From 11e609414024f3c1ff7178827496704eefa51da1 Mon Sep 17 00:00:00 2001 From: georglauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:22:16 +0100 Subject: [PATCH] update symbols weights according to updates in #3690 I updated the symbol weights according to my new insights in #3690 to fix a bug pointed out by @2GetApp and to improve the logic itself. Previously, I reasoned about combinations of symbols that cannot exists, e.g., SPF allow, DKIM allow, DMARC reject. Removing these symbols and then reasoning about the rest is more appropriate. Moreover, I added `DMARC_POLICY_NA` and `DMARC_POLICY_SOFTFAIL` to the whole calculation. The issue description of #3690 I updated. I also added the Rust code I used to do and verify the calculations. --- target/rspamd/scores.d/policies_group.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/rspamd/scores.d/policies_group.conf b/target/rspamd/scores.d/policies_group.conf index ee2bc28a..9c58363e 100644 --- a/target/rspamd/scores.d/policies_group.conf +++ b/target/rspamd/scores.d/policies_group.conf @@ -54,7 +54,7 @@ symbols = { groups = ["dkim"]; } "R_DKIM_NA" { # DKIM is not available for this domain - weight = 0; + weight = 1; description = "Missing DKIM signature"; one_shot = true; groups = ["dkim"]; @@ -84,12 +84,12 @@ symbols = { groups = ["dmarc"]; } "DMARC_POLICY_ALLOW_WITH_FAILURES" { # DMARC check succeeded but either SPF or DKIM was not successful - weight = -0.5; + weight = 0; description = "DMARC permit policy with DKIM/SPF failure"; groups = ["dmarc"]; } "DMARC_NA" { # DMARC is not available for this domain - weight = 1; + weight = 0.5; description = "No DMARC record"; groups = ["dmarc"]; } @@ -99,12 +99,12 @@ symbols = { groups = ["dmarc"]; } "DMARC_POLICY_QUARANTINE" { # DMARC check failed and the policy is to quarantine - weight = 1.5; + weight = 3; description = "DMARC quarantine policy"; groups = ["dmarc"]; } "DMARC_POLICY_REJECT" { # DMARC check failed and the policy is to reject - weight = 2; + weight = 5.5; description = "DMARC reject policy"; groups = ["dmarc"]; }