pop3://user:password@server:port CONNECTION_SECURITY_NONE
pop3+tls://user:password@server:port CONNECTION_SECURITY_TLS_OPTIONAL
pop3+tls+://user:password@server:port CONNECTION_SECURITY_TLS_REQUIRED
pop3+ssl+://user:password@server:port CONNECTION_SECURITY_SSL_REQUIRED
pop3+ssl://user:password@server:port CONNECTION_SECURITY_SSL_OPTIONAL
// /**
// * Detected latency, used for usage scaling.
// * Usage scaling occurs when it is neccesary to get information about
// * messages that could result in large data loads. This value allows
// * the code that loads this data to decide between using large downloads
// * (high latency) or multiple round trips (low latency) to accomplish
// * the same thing.
// * Default is Integer.MAX_VALUE implying massive latency so that the large
// * download method is used by default until latency data is collected.
// */
// private int mLatencyMs = Integer.MAX_VALUE;
//
// /**
// * Detected throughput, used for usage scaling.
// * Usage scaling occurs when it is neccesary to get information about
// * messages that could result in large data loads. This value allows
// * the code that loads this data to decide between using large downloads
// * (high latency) or multiple round trips (low latency) to accomplish
// * the same thing.
// * Default is Integer.MAX_VALUE implying massive bandwidth so that the
// * large download method is used by default until latency data is
// * collected.
// */
// private int mThroughputKbS = Integer.MAX_VALUE;
URI uri;
try {
uri = new URI(_uri);
} catch (URISyntaxException use) {
throw new MessagingException("Invalid Pop3Store URI", use);
}
String scheme = uri.getScheme();
int connectionSecurity = Transport.CONNECTION_SECURITY_NONE;
int defaultPort = -1;
if (scheme.equals(STORE_SCHEME_POP3)) {
connectionSecurity = Transport.CONNECTION_SECURITY_NONE;
defaultPort = 110;
} else if (scheme.equals(STORE_SCHEME_POP3 + "+tls")) {
connectionSecurity = Transport.CONNECTION_SECURITY_TLS_OPTIONAL;
defaultPort = 110;
} else if (scheme.equals(STORE_SCHEME_POP3 + "+tls+")) {
connectionSecurity = Transport.CONNECTION_SECURITY_TLS_REQUIRED;
defaultPort = 110;
} else if (scheme.equals(STORE_SCHEME_POP3 + "+ssl+")) {
connectionSecurity = Transport.CONNECTION_SECURITY_SSL_REQUIRED;
defaultPort = 995;
} else if (scheme.equals(STORE_SCHEME_POP3 + "+ssl")) {
connectionSecurity = Transport.CONNECTION_SECURITY_SSL_OPTIONAL;
defaultPort = 995;
} else {
throw new MessagingException("Unsupported protocol");
}
mTransport = new MailTransport("POP3");
mTransport.setUri(uri, defaultPort);
mTransport.setSecurity(connectionSecurity);
String[] userInfoParts = mTransport.getUserInfoParts();
if (userInfoParts != null) {
mUsername = userInfoParts[0];
if (userInfoParts.length > 1) {
mPassword = userInfoParts[1];
}
}