From 657962cba173a895389ff79ea0d0bbdb0b2b88d1 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 24 Sep 2021 21:53:04 +0200 Subject: [PATCH] Outlook WTF --- app/src/main/java/eu/faircode/email/EmailService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 71cb0c4dc6..ce787cd579 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -413,6 +413,13 @@ public class EmailService implements AutoCloseable { connect(host, port, auth, user, authenticator, factory); } catch (AuthenticationFailedException ex) { + if ("outlook.office365.com".equals(host) && + "AUTHENTICATE failed.".equals(ex.getMessage())) + throw new AuthenticationFailedException( + "The Outlook IMAP server currently fails to authenticate. " + + "Synchronizing and configuring accounts will work again after Microsoft has fixed this.", + ex.getNextException()); + if (auth == AUTH_TYPE_GMAIL || auth == AUTH_TYPE_OAUTH) { try { authenticator.refreshToken(true);