From 3e9d4ac5548fc4afa79c478daa6da0be89adf361 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 14 Jan 2021 12:35:24 +0100 Subject: [PATCH] Explicit enable/disable xoauth2 --- app/src/main/java/eu/faircode/email/EmailService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 9d63c73032..c18fdb309c 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -380,8 +380,11 @@ public class EmailService implements AutoCloseable { ServiceAuthenticator authenticator = new ServiceAuthenticator(context, auth, provider, user, password, intf); try { - if (auth == AUTH_TYPE_GMAIL || auth == AUTH_TYPE_OAUTH) + if (auth == AUTH_TYPE_GMAIL || auth == AUTH_TYPE_OAUTH) { properties.put("mail." + protocol + ".auth.mechanisms", "XOAUTH2"); + properties.put("mail." + protocol + ".auth.xoauth2.disable", "false"); + } else + properties.put("mail." + protocol + ".auth.xoauth2.disable", "true"); if (auth == AUTH_TYPE_OAUTH && "imap.mail.yahoo.com".equals(host)) properties.put("mail." + protocol + ".yahoo.guid", "FAIRMAIL_V1");