My project recently upgraded grails from 2.0.0 to 2.4.3. In a domain object I am using the email validation constraint. I've noticed in testing that emails with fake tlds eg '[email protected]' are now considered invalid. Grails documentation says it is using Apache Commons EmailValidation class to do the validating. That documentation explicitly states that it doesn't check for valid tlds.
Has anyone else seen this issue, and if so was there a simple work around? I am on the fence between a custom validator that allows invalid tlds or removing the constraint all together.
It would appear that the new Commons Vaidator v1.4.0 which is used by Grails v2.4.3 has an open bug VALIDATOR-338 where unknown TLDs in e-mail addresses are invalid. This only effects 1.4 and not 1.3.1 which Grails 2.0.0 used.
The quickest route would be to implement a custom validator for now. You might even get away with using a custom regular expression (of which there are many examples of).