Skip to content

Expand email alias domain lists - #430

Open
faktas2 wants to merge 1 commit into
mainfrom
expand-email-alias-domains
Open

Expand email alias domain lists#430
faktas2 wants to merge 1 commit into
mainfrom
expand-email-alias-domains

Conversation

@faktas2

@faktas2 faktas2 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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 MX
    records resolving to Fastmail's messagingengine.com infrastructure,
    and listed on Fastmail's official domain list.
  • myyahoo.com — an alternate Yahoo-owned signup domain (WHOIS
    registrant: 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

  • Bug Fixes
    • Improved email address normalization for Fastmail and Yahoo-related domains.
    • Aliased addresses using supported domains are now consistently converted to their canonical forms during processing.
    • Added coverage for Fastmail Canada and My Yahoo address formats.

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.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Expanded email-domain normalization support for fastmail.ca and myyahoo.com, with parameterized tests covering Fastmail and Yahoo alias cleaning.

Changes

Email normalization

Layer / File(s) Summary
Domain allowlists and normalization coverage
src/minfraud/request.py, tests/test_request.py
_clean_email recognizes the added Fastmail and Yahoo domains, with tests covering their normalized email outputs.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Poem

I’m a rabbit with ears held high,
As Fastmail and Yahoo domains hop by.
Aliases fade, clean addresses appear,
Two tiny test cases make it clear.
Sniff sniff—normalization is neat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: expanding email alias domain lists used for normalization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch expand-email-alias-domains

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 256e59b and 80ca75f.

📒 Files selected for processing (2)
  • src/minfraud/request.py
  • tests/test_request.py

Comment thread tests/test_request.py
Comment on lines +246 to +248
{"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"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant