Pre expire tokens

This commit is contained in:
M66B
2021-07-17 13:33:25 +02:00
parent e7f870ef4d
commit 35a4b1fed9
3 changed files with 38 additions and 14 deletions

View File

@@ -309,7 +309,7 @@ public class EmailService implements AutoCloseable {
public void connect(EntityAccount account) throws MessagingException {
connect(
account.host, account.port,
account.auth_type, account.provider,
account.auth_type, account.provider, account.poll_interval,
account.user, account.password,
new ServiceAuthenticator.IAuthenticated() {
@Override
@@ -326,7 +326,7 @@ public class EmailService implements AutoCloseable {
public void connect(EntityIdentity identity) throws MessagingException {
connect(
identity.host, identity.port,
identity.auth_type, identity.provider,
identity.auth_type, identity.provider, 0,
identity.user, identity.password,
new ServiceAuthenticator.IAuthenticated() {
@Override
@@ -342,14 +342,16 @@ public class EmailService implements AutoCloseable {
public void connect(
String host, int port,
int auth, String provider, String user, String password,
int auth, String provider,
String user, String password,
String certificate, String fingerprint) throws MessagingException {
connect(host, port, auth, provider, user, password, null, certificate, fingerprint);
connect(host, port, auth, provider, 0, user, password, null, certificate, fingerprint);
}
private void connect(
String host, int port,
int auth, String provider, String user, String password,
int auth, String provider, int keep_alive,
String user, String password,
ServiceAuthenticator.IAuthenticated intf,
String certificate, String fingerprint) throws MessagingException {
SSLSocketFactoryService factory = null;
@@ -378,7 +380,8 @@ public class EmailService implements AutoCloseable {
}
properties.put("mail." + protocol + ".forcepasswordrefresh", "true");
ServiceAuthenticator authenticator = new ServiceAuthenticator(context, auth, provider, user, password, intf);
ServiceAuthenticator authenticator = new ServiceAuthenticator(context,
auth, provider, keep_alive, user, password, intf);
try {
if (auth == AUTH_TYPE_GMAIL || auth == AUTH_TYPE_OAUTH) {