From ab8a5fd7f6dcad1827ccbe233157f661af77c259 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 12 Dec 2022 10:36:31 +0100 Subject: [PATCH] Handle Command Error. 10 --- .../java/eu/faircode/email/EmailService.java | 28 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 29 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 0cfa2a3e52..f20a9b0595 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -522,6 +522,34 @@ public class EmailService implements AutoCloseable { } else throw ex; } catch (MessagingException ex) { + /* + javax.mail.MessagingException: FY1 BAD Command Error. 10; + nested exception is: + com.sun.mail.iap.BadCommandException: FY1 BAD Command Error. 10 + javax.mail.MessagingException: FY1 BAD Command Error. 10; + nested exception is: + com.sun.mail.iap.BadCommandException: FY1 BAD Command Error. 10 + at com.sun.mail.imap.IMAPStore.protocolConnect(SourceFile:40) + at javax.mail.Service.connect(SourceFile:31) + at eu.faircode.email.EmailService._connect(SourceFile:31) + at eu.faircode.email.EmailService.connect(SourceFile:99) + at eu.faircode.email.EmailService.connect(SourceFile:40) + at eu.faircode.email.EmailService.connect(SourceFile:4) + at eu.faircode.email.ServiceSynchronize.monitorAccount(SourceFile:40) + at eu.faircode.email.ServiceSynchronize.access$1100(SourceFile:1) + at eu.faircode.email.ServiceSynchronize$4$2.run(SourceFile:1) + at java.lang.Thread.run(Thread.java:919) + Caused by: com.sun.mail.iap.BadCommandException: FY1 BAD Command Error. 10 + at com.sun.mail.iap.Protocol.handleResult(SourceFile:7) + at com.sun.mail.imap.protocol.IMAPProtocol.handleLoginResult(SourceFile:4) + at com.sun.mail.imap.protocol.IMAPProtocol.authoauth2(SourceFile:36) + at com.sun.mail.imap.IMAPStore.authenticate(SourceFile:24) + at com.sun.mail.imap.IMAPStore.login(SourceFile:22) + at com.sun.mail.imap.IMAPStore.protocolConnect(SourceFile:24) + */ + if (ex.getMessage() != null && ex.getMessage().contains("Command Error. 10")) + throw new AuthenticationFailedException(context.getString(R.string.title_service_error10), ex); + if (purpose == PURPOSE_CHECK) { if (port == 995 && !("pop3".equals(protocol) || "pop3s".equals(protocol))) throw new MessagingException(context.getString(R.string.title_service_port), ex); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a772e1ca11..80beb9c24e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1104,6 +1104,7 @@ The Android account manager could be blocked by a VPN, firewall, ad blocker, etc., preventing it from obtaining an access token Please double check the port number Please double check the protocol (SSL/TLS or STARTTLS) + This account needs to be authenticated again, which can be done via the quick setup wizard Browse messages on the server Mark messages read on expanding