Skip to content

Commit d0eb6af

Browse files
committed
bump mx-only to 0.8
1 parent 44898a8 commit d0eb6af

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/mail_sovereignty/classifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _rule_confidence(
105105
R4 MX ∧ TENANT 0.85
106106
R5 SPF ∧ TENANT 0.80
107107
R6 SPF ∧ GW 0.70
108-
R7 MX 0.60 // eher auf 80%
108+
R7 MX 0.80
109109
R8 SPF 0.50
110110
R9 else 0.40
111111
==== ========================== ====
@@ -134,7 +134,7 @@ def _rule_confidence(
134134
elif has_spf and has_gateway:
135135
base, used = 0.70, {SignalKind.SPF}
136136
elif has_mx:
137-
base, used = 0.60, {SignalKind.MX}
137+
base, used = 0.80, {SignalKind.MX}
138138
elif has_spf:
139139
base, used = 0.50, {SignalKind.SPF}
140140
else:

tests/test_classifier.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def test_single_signal(self):
141141
evidence = [_ev(SignalKind.MX, Provider.MS365)]
142142
result = _aggregate(evidence)
143143
assert result.provider == Provider.MS365
144-
# MX-only rule → 0.60
145-
assert result.confidence == pytest.approx(0.60)
144+
# MX-only rule → 0.80
145+
assert result.confidence == pytest.approx(0.80)
146146

147147
def test_multi_signal_same_provider(self):
148148
evidence = [
@@ -162,8 +162,8 @@ def test_duplicate_kind_same_depth(self):
162162
]
163163
result = _aggregate(evidence)
164164
assert result.provider == Provider.MS365
165-
# MX-only rule → 0.60 (duplicate MX doesn't change anything)
166-
assert result.confidence == pytest.approx(0.60)
165+
# MX-only rule → 0.80 (duplicate MX doesn't change anything)
166+
assert result.confidence == pytest.approx(0.80)
167167

168168
def test_conflict_more_primary_signals_wins(self):
169169
evidence = [
@@ -271,8 +271,8 @@ def test_tenant_different_provider_no_effect_on_winner(self):
271271
]
272272
result = _aggregate(evidence)
273273
assert result.provider == Provider.GOOGLE
274-
# MX-only rule → 0.60 (TENANT is MS365's, not Google's)
275-
assert result.confidence == pytest.approx(0.60)
274+
# MX-only rule → 0.80 (TENANT is MS365's, not Google's)
275+
assert result.confidence == pytest.approx(0.80)
276276

277277
def test_txt_verification_alone_no_winner(self):
278278
"""TXT_VERIFICATION alone cannot pick a winner (not primary)."""
@@ -292,8 +292,8 @@ def test_txt_verification_with_primary(self):
292292
]
293293
result = _aggregate(evidence)
294294
assert result.provider == Provider.MS365
295-
# MX-only rule (0.60) + TXT_VERIFICATION boost (0.02) = 0.62
296-
assert result.confidence == pytest.approx(0.62)
295+
# MX-only rule (0.80) + TXT_VERIFICATION boost (0.02) = 0.82
296+
assert result.confidence == pytest.approx(0.82)
297297

298298
def test_asn_alone_no_winner(self):
299299
"""ASN alone cannot pick a winner (not primary)."""
@@ -313,8 +313,8 @@ def test_asn_with_primary(self):
313313
]
314314
result = _aggregate(evidence)
315315
assert result.provider == Provider.MS365
316-
# MX-only rule (0.60) + ASN boost (0.02) = 0.62
317-
assert result.confidence == pytest.approx(0.62)
316+
# MX-only rule (0.80) + ASN boost (0.02) = 0.82
317+
assert result.confidence == pytest.approx(0.82)
318318

319319
def test_infomaniak_classification(self):
320320
evidence = [
@@ -352,8 +352,8 @@ def test_spf_ip_with_primary(self):
352352
]
353353
result = _aggregate(evidence)
354354
assert result.provider == Provider.GOOGLE
355-
# MX-only rule (0.60) + SPF_IP boost (0.02) = 0.62
356-
assert result.confidence == pytest.approx(0.62)
355+
# MX-only rule (0.80) + SPF_IP boost (0.02) = 0.82
356+
assert result.confidence == pytest.approx(0.82)
357357

358358
def test_autodiscover_is_primary_signal(self):
359359
"""Autodiscover alone establishes a provider (not INDEPENDENT)."""

0 commit comments

Comments
 (0)