Skip to content

Commit 7549803

Browse files
committed
Normalize more gmail leading digit domains
1 parent e3a87df commit 7549803

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
become `example.com`.
2323
* Certain `.com` typos are now normalized to `.com` when `hash_address` is
2424
used. For example, `example.cam` will become `example.com`.
25+
* Additional `gmail.com` domain names with leading digits are now
26+
normalized when `hash_address` is used. For example, `100gmail.com` will
27+
become `gmail.com`.
2528

2629
## v2.4.0 (2024-01-12)
2730

lib/minfraud/components/email.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def clean_domain(domain)
329329
domain.sub!(/(?:\.com){2,}$/, '.com')
330330
domain.sub!(/\.com[^.]+$/, '.com')
331331
domain.sub!(/(?:\.(?:com|c[a-z]{1,2}m|co[ln]|[dsvx]o[mn]|))$/, '.com')
332+
domain.sub!(/^\d+(?:gmail?\.com)$/, 'gmail.com')
332333

333334
if TYPO_DOMAINS.key?(domain)
334335
domain = TYPO_DOMAINS[domain]

spec/components/email_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
{ input: '[email protected]', output: '[email protected]' },
7979
{ input: '[email protected]', output: '[email protected]' },
8080
{ input: '[email protected]', output: '[email protected]' },
81+
{ input: '[email protected]', output: '[email protected]' },
8182
]
8283

8384
tests.each do |i|

0 commit comments

Comments
 (0)