-
-
Notifications
You must be signed in to change notification settings - Fork 269
Consider all domain suffixes for blacklisting and normalise implementations #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Use the (better) regex from the Ruby code for checking for well-formed email addresses, - Check for matches using identity equality (is/is not None), - Use stdlib unittest module for tests and import testcases from Ruby
- Add instructions to run tests - Ensure minitest is a development dependency - Add tests for blank emails
- Use PHPUnit test framework (via composer dependency) - Add instructions to run tests
- Multiple expectations per test - Add blank/empty invalid email tests
- Use the same valid email regexp everywhere - based on PHP's FILTER_VALIDATE_EMAIL, - Lowercase the list entries in the generator, rather than in each match implementation.
I can't work out why circle ci is failing on
|
Consider all domain suffixes for blacklisting and normalise implementations
Very impressive work @owst!! Thanks a lot! |
You're welcome, thanks for maintaining the project! How do we go about getting a new Ruby gem published? At work we're currently overriding By the way, do you have any idea why |
Hello @owst , It's now fixed, I pushed ruby-mailchecker-1.6.3.gem :) |
Great, thanks! |
This change was triggered by the Ruby implementation not matching any blacklisted domains with more than 1 subdomain, e.g.
test@spamthis.co.uk
would not be considered invalid, even thoughspamthis.co.uk
is a blacklisted domain.This refactoring normalises the implementation across the 7 languages:
This removes false-negatives (e.g. where the domain includes > 2 subdomains) in some cases, and false-positives (e.g. where a blacklisted domain appears as a subdomain) in other cases.
As a side effect, several improvements were made to the tests of PHP, Python in particular, using standard libraries for unit testing rather than ad-hoc tests.
Meta: I think this will be easiest to review on a commit-by-commit basis. This PR is based off my other pending PR, so that PR's commit also shows up here.