Replace old email validation library with its successor
bbottema opened this issue · 3 comments
bbottema commented
The email validation library was turned off by default because of performance / crashing bugs (#3). However, it has been improved upon by another maintainer who now use it in commercial products.
http://stackoverflow.com/a/13133880/441662
http://lacinato.com/cm/software/emailrelated/emailaddress
I'm putting it into github so anyone can contribute.
bbottema commented
bbottema commented
Started using code from bbottema/email-rfc2822-validator and turned the email validation routine back on by default.
bbottema commented
Release in v3.0.0!
Example through Mailer:
Mailer mailer = new Mailer(...); // already uses default RFC compliant validation
// customize to your needs ->
mailer.setEmailAddressCriteria(null);
mailer.setEmailAddressCriteria(EmailAddressCriteria.RFC_COMPLIANT);
mailer.setEmailAddressCriteria(EmailAddressCriteria.DEFAULT);
// or:
mailer.setEmailAddressCriteria(EnumSet.of(ALLOW_DOT_IN_A_TEXT, ALLOW_SQUARE_BRACKETS_IN_A_TEXT));
mailer.validateEmail(email);
You can also use the EmailAddressValidator
directly (see https://github.com/bbottema/email-rfc2822-validator for that).