email-domain-typo-finder v1.0.0
email-domain-typo-finder
Crystal command line tool and library. Give it a text file with one email address per line and it flags every address whose domain is not a common mailbox domain but is one or two typed characters away from exactly one (gmial.com, yaho.com, outlok.com), then prints the corrected address. Distance is Levenshtein edit distance: 1 always, 2 only when the domain is 6 or more characters. A domain close to more than one known domain is left alone. Built in list: gmail.com, yahoo.com, outlook.com, hotmail.com, icloud.com, aol.com, proton.me, live.com, msn.com. Add your own with --domains FILE (one domain per line).
Part of the OneGTMLab free GTM tools. Background on the idea: email finder.
Install
shards build # then ./bin/email-domain-typo-finder
Use
Input: one email address per line. Blank lines are skipped; a line without a single @ stops the run with an error naming the line. Output: line, address, suggestion, distance, then the counts checked, suspected typos and clean.
$ ./bin/email-domain-typo-finder sample.txt
line address suggestion distance
2 ben@gmial.com ben@gmail.com 2
3 cara@yaho.com cara@yahoo.com 1
5 dan@outlok.com dan@outlook.com 1
6 eve@hotmal.com eve@hotmail.com 1
7 fay@icloud.con fay@icloud.com 1
10 ivy@gnail.com ivy@gmail.com 1
11 jo@aol.co jo@aol.com 1
checked: 10
suspected typos: 7
clean: 3
Test
crystal spec
Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.
email-domain-typo-finder
- 0
- 0
- 0
- 0
- 0
- about 1 hour ago
- November 28, 2026
MIT License
Sat, 28 Nov 2026 22:42:11 GMT