Expand email alias domain lists - #430
Conversation
Add fastmail.ca to the Fastmail domain set and myyahoo.com to the Yahoo domain set, so more equivalent addresses normalize to the same value before hashing. Both are confirmed to run on their provider's own mail platform with no third-party migration history.
📝 WalkthroughWalkthroughExpanded email-domain normalization support for ChangesEmail normalization
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_request.py`:
- Around line 246-248: Add corresponding maybe_hash_email coverage in the email
normalization tests for the Fastmail and Yahoo alias domains, asserting expected
MD5 values and normalized domain fields for aliased and already-normalized
addresses; also retain coverage for raw and hashed empty-string inputs as
required by the existing test conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a715aaac-ca2c-4fd0-b6be-e49d9781f4fa
📒 Files selected for processing (2)
src/minfraud/request.pytests/test_request.py
| {"input": "alias@user.fastmail.ca", "output": "user@fastmail.ca"}, | ||
| {"input": "foo-bar@ymail.com", "output": "foo@ymail.com"}, | ||
| {"input": "test-alias@myyahoo.com", "output": "test@myyahoo.com"}, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Cover the new aliases in hashed-email tests.
These cases exercise _clean_email only. Add corresponding maybe_hash_email cases for both domains, including expected MD5 values and normalized domain fields for aliased and already-normalized addresses.
As per coding guidelines, tests/test_request.py email normalization changes must test raw and hashed email results, including empty strings and already-normalized addresses.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/test_request.py` around lines 246 - 248, Add corresponding
maybe_hash_email coverage in the email normalization tests for the Fastmail and
Yahoo alias domains, asserting expected MD5 values and normalized domain fields
for aliased and already-normalized addresses; also retain coverage for raw and
hashed empty-string inputs as required by the existing test conventions.
Source: Coding guidelines
Summary
Adds two newly identified alias domains so more equivalent addresses
normalize to the same value before hashing:
fastmail.ca— Fastmail's own Canadian domain. Confirmed via MXrecords resolving to Fastmail's
messagingengine.cominfrastructure,and listed on Fastmail's official domain list.
myyahoo.com— an alternate Yahoo-owned signup domain (WHOISregistrant: Yahoo Assets LLC), functionally identical to yahoo.com.
Both run on their provider's own native mail platform with no
third-party migration history, so the existing normalization logic
applies to them exactly as it does to their canonical counterparts.
This mirrors the same addition made to the minFraud web service's own
email normalization.
Testing
3/3 tests pass (
pytest), including 20 subtests.🤖 Generated with Claude Code
Summary by CodeRabbit