jakartaee / mail-api

Jakarta Mail Specification project
https://jakartaee.github.io/mail-api
Other
244 stars 101 forks source link

Double dots are still normal in some environments #511

Open rickstev opened 3 years ago

rickstev commented 3 years ago

In previous editions of Javamail, an unquoted local part containing double dots (and I believe leading or trailing dots) was acceptable. Some providers in Japan, such as NTT, still have many users whose addresses contain double dots. In the 2.0.0 release of Jakarta mail, this is no longer allowed and there is no way to override it through non-strict verification.

To Reproduce Steps to reproduce the behavior: In Java the following will throw an AddressException InternetAddress ia = new InternetAddress( "a..b@foo.com", true);

Expected behavior There needs to be a way to allow double dots and or leading and or trailing dots to be accepted.
One way to do this would be add a new system property, e.g. "mail.mime.allowdoubledots" and modify the logic to respect that property.

tweimer commented 3 years ago

I reported that in #322 1f017aeedfea8e15e8300258ff4cc5e8c9c6dd2c

jmehrens commented 3 years ago

If the environment has non-compliant email addresses then the mail.mime.address.strict session property (not system property) should be set to false. InternetAddress::validate can be invoked manually to verify addresses.

The commit for the change is here: https://github.com/eclipse-ee4j/mail/commit/1580d063cdcd966cfebcb2f1e3a29094bb0ad22d