aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_case.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-09 19:15:44 +0200
committerDanilo M. <danix@danix.xyz>2026-09-09 19:15:44 +0200
commitd8161dae1fce1b5e5ffd757f411e1123b2f5dfa5 (patch)
treee38578dfb59beeb300c577dcb8bf7837337e7afd /tests/test_case.py
parent7275db9f81e9995318441807aa0a80022c84d55f (diff)
downloadabusectl-d8161dae1fce1b5e5ffd757f411e1123b2f5dfa5.tar.gz
abusectl-d8161dae1fce1b5e5ffd757f411e1123b2f5dfa5.zip
fix: fold a role mailbox's case, and test the half that was not tested
"Abuse@Host.Invalid" and "abuse@host.invalid" produced two destinations and two mails to one desk, which is the duplicate-mail behaviour the grouping exists to prevent. The root cause is the test, not the grouping. _group_key folded the domain correctly, but the test written for it used a lowercase local part in both of its inputs, so it varied only the half that worked and passed while the other half was never exercised. A test that varies one half of its input proves nothing about the other. The local part now folds for the RFC 2142 role mailboxes. That RFC mandates those names and requires them matched case-insensitively, so no host runs "Abuse@" and "abuse@" as different desks and treating them as two costs a duplicate mail with nothing on the other side of the trade. This reverses the earlier decision only for the standardised names: any other local part is still left as published, because for a named mailbox folding could merge two desks a host genuinely distinguishes, and a dropped desk is worse than a duplicate. Each half now folds on the strength of its own standard. Both folds are mutation-checked and killed by distinct tests, so neither masks the other, and the role fold is checked across all five role names. Also pins two behaviours that held only by luck: the caller's contacts are not modified, and a destination's ioc list is not aliased to the contact's. Both are true today because the grouping starts a fresh list, and nothing would have caught an implementation that reused the contact's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xj1ayFRSUQ2u7cwb3S4axE
Diffstat (limited to 'tests/test_case.py')
0 files changed, 0 insertions, 0 deletions