Kicksend/mailcheck — pull request #24 by hpshelton (2012-04-08 02:55:32+00:00)
Title: Initial implementation of TLD correction suggestions

If the user submits an address which does not closely match one of the supplied domains, fall back to checking whether or not the address's top-level domain is simply misspelled and matches a small built-in list. Should take care of [Issue #23](https://github.com/Kicksend/mailcheck/issues/23)

It's up to the admins to decide whether or not to modify the initialization API to support user-provided TLD suggestions along with user-provided domain suggestions, but that seems unnecessary.

Right now I only shave off the first subdomain in the provided address, which works in the majority of cases. This could in theory be improved to accurately detect the TLD for addresses with multiple subdomains to support correct suggestions for addresses like "mail.small.randomcompany.cmo". This seemed liked overengineering, so open an additional issue for this improvement if it's desired.