From 823b6f2e4fe0e74ea93de1793d0c258f9f2e2fa2 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 27 Oct 2024 16:31:23 +0100 Subject: [PATCH] Individual folders can have no NOTIFY support --- .../java/eu/faircode/email/ServiceSynchronize.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 5c41f8e108..1c11d8fe8e 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -2127,7 +2127,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences EntityOperation.sync(this, folder.id, false, force && !forced); - if (capNotify && subscriptions && EntityFolder.INBOX.equals(folder.type)) + if (capNotify && subscriptions && + EntityFolder.INBOX.equals(folder.type) && + MessageHelper.hasCapability(ifolder, "NOTIFY")) ifolder.doCommand(new IMAPFolder.ProtocolCommand() { @Override public Object doCommand(IMAPProtocol protocol) throws ProtocolException { @@ -2144,8 +2146,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences if (responses.length == 0) throw new ProtocolException("No response"); - if (!responses[responses.length - 1].isOK()) - throw new ProtocolException(responses[responses.length - 1]); + if (!responses[responses.length - 1].isOK()) { + Log.w(new ProtocolException(responses[responses.length - 1])); + return null; + } for (int i = 0; i < responses.length - 1; i++) { EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Account, account,