This commit is contained in:
M66B 2021-03-11 10:27:38 +01:00
parent 670a5d8b20
commit 30ecd4fcd1
1 changed files with 3 additions and 4 deletions

View File

@ -560,10 +560,12 @@ public class EmailService implements AutoCloseable {
private void _connect( private void _connect(
InetAddress address, int port, boolean require_id, InetAddress address, int port, boolean require_id,
String user, Authenticator authenticator, String _user, Authenticator authenticator,
SSLSocketFactoryService factory) throws MessagingException { SSLSocketFactoryService factory) throws MessagingException {
isession = Session.getInstance(properties, authenticator); isession = Session.getInstance(properties, authenticator);
String user = (TextUtils.isEmpty(_user) ? null : _user);
isession.setDebug(debug || log); isession.setDebug(debug || log);
if (debug || log) if (debug || log)
isession.setDebugOut(new PrintStream(new OutputStream() { isession.setDebugOut(new PrintStream(new OutputStream() {
@ -593,9 +595,6 @@ public class EmailService implements AutoCloseable {
//System.setProperty("mail.socket.debug", Boolean.toString(debug)); //System.setProperty("mail.socket.debug", Boolean.toString(debug));
isession.addProvider(new GmailSSLProvider()); isession.addProvider(new GmailSSLProvider());
if (TextUtils.isEmpty(user))
user = null;
if ("pop3".equals(protocol) || "pop3s".equals(protocol)) { if ("pop3".equals(protocol) || "pop3s".equals(protocol)) {
iservice = isession.getStore(protocol); iservice = isession.getStore(protocol);
iservice.connect(address.getHostAddress(), port, user, null); iservice.connect(address.getHostAddress(), port, user, null);