dev@javamail.java.net

Username and host can't be parsed when username contains _at_

From: <emeratius_at_gmail.com>
Date: Mon, 25 Oct 2010 09:54:45 +0000 (GMT)

Hi,

I got the wrong host when the username contains @.

In URLName.parseString the fulluserpass and fullhost is collected by
indexOf('@').

I should be lastIndexOf('@')

// examine the fullhost, for username password etc.
int i = fullhost.lastIndexOf('@');
if (i != -1) {
        String fulluserpass = fullhost.substring(0, i);
        fullhost = fullhost.substring(i + 1);