mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

Validation not RFC-822 compliant when mail.mime.allowutf8=false

Open runningonfumes opened this issue 5 years ago • 3 comments

changes made for Support addressing i18n via RFC 6530/6531/6532 (6216) breaks behavior when mail.mime.allowutf8 is not true

This code in InternetAddress.java does not take into account that setting. If mail.mime.allowutf8 = false, I think the check should still be c >= 0177 instead of c == 0177

if (c <= 040 || c == 0177) throw new AddressException( "Local address contains control or whitespace", addr);

Checking an email address like pé[email protected] used to throw an exception, now it does not, regardless of the value of mail.mime.allowutf8

runningonfumes avatar Mar 06 '19 14:03 runningonfumes

Yes, you're right, thanks!

bshannon avatar Mar 22 '19 23:03 bshannon

Unfortunately, fixing this causes the TCK to fail, so this fix will need to be deferred until the TCK can be fixed as well. In the mean time, the server should fail if given an address that includes characters it doesn't support.

bshannon avatar Mar 22 '19 23:03 bshannon

@bshannon was this fixed in the end?

trantor avatar Jun 26 '21 12:06 trantor