From 06d13a17e3a19aa5f1e3413186674097de7a5859 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 18 Feb 2022 15:32:30 +0100 Subject: [PATCH] Mailbox doesn't exist --- .../eu/faircode/email/ServiceSynchronize.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index eace817537..afe6131801 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -51,6 +51,7 @@ import androidx.lifecycle.Observer; import androidx.preference.PreferenceManager; import com.sun.mail.iap.Argument; +import com.sun.mail.iap.CommandFailedException; import com.sun.mail.iap.ProtocolException; import com.sun.mail.iap.Response; import com.sun.mail.imap.IMAPFolder; @@ -2000,6 +2001,30 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Account, folder, account.name + "/" + folder.name + " process " + Log.formatThrowable(ex, false)); db.folder().setFolderError(folder.id, Log.formatThrowable(ex)); + + /* + javax.mail.MessagingException: GS38 NO Mailbox doesn't exist: 0 XXX (0.020 + 0.000 + 0.019 secs).; + nested exception is: + com.sun.mail.iap.CommandFailedException: GS38 NO Mailbox doesn't exist: 0 XXX (0.020 + 0.000 + 0.019 secs). + at com.sun.mail.imap.IMAPFolder.open(SourceFile:61) + at com.sun.mail.imap.IMAPFolder.open(SourceFile:1) + at eu.faircode.email.ServiceSynchronize$19$1$2.run(SourceFile:30) + at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459) + at java.util.concurrent.FutureTask.run(FutureTask.java:266) + at eu.faircode.email.Helper$PriorityFuture.run(SourceFile:1) + at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) + at java.lang.Thread.run(Thread.java:764) + Caused by: com.sun.mail.iap.CommandFailedException: GS38 NO Mailbox doesn't exist: 0 XXX (0.020 + 0.000 + 0.019 secs). + at com.sun.mail.iap.Protocol.handleResult(SourceFile:8) + at com.sun.mail.imap.protocol.IMAPProtocol.select(SourceFile:19) + at com.sun.mail.imap.IMAPFolder.open(SourceFile:16) + */ + if (ex.getMessage() != null && + (ex.getMessage().contains("Mailbox doesn't exist") || + ex.getMessage().contains("Mailbox does not exist"))) + ex = new FolderNotFoundException(ifolder, ex.getMessage(), (Exception) ex); + if (!(ex instanceof FolderNotFoundException)) state.error(new Core.OperationCanceledExceptionEx("Process", ex)); } finally {