Backwards compatibility for the CRAM-MD5 implementation

This commit is contained in:
Jesse Vincent 2009-12-20 06:14:04 +00:00
parent 3914a78b53
commit 2c9fc8b997
1 changed files with 12 additions and 3 deletions

View File

@ -158,10 +158,19 @@ public class ImapStore extends Store
if (uri.getUserInfo() != null) if (uri.getUserInfo() != null)
{ {
String[] userInfoParts = uri.getUserInfo().split(":"); String[] userInfoParts = uri.getUserInfo().split(":");
if (userInfoParts.length == 2)
{
mAuthType = AuthType.PLAIN;
mUsername = userInfoParts[0];
mPassword = userInfoParts[1];
}
else
{
mAuthType = AuthType.valueOf(userInfoParts[0]); mAuthType = AuthType.valueOf(userInfoParts[0]);
mUsername = userInfoParts[1]; mUsername = userInfoParts[1];
mPassword = userInfoParts[2]; mPassword = userInfoParts[2];
} }
}
if ((uri.getPath() != null) && (uri.getPath().length() > 0)) if ((uri.getPath() != null) && (uri.getPath().length() > 0))
{ {