From fa48c8c7e4dc42cb5ed109a179ec0d7c8ebdcd5c Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 5 Feb 2021 09:22:26 +0100 Subject: [PATCH] Handle expunge fail on add --- app/src/main/java/eu/faircode/email/Core.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 64572db935..65fc5c9869 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -652,12 +652,18 @@ class Core { Log.i(name + " deleting uid=" + muid + " for msgid=" + msgid); iexisting.setFlag(Flags.Flag.DELETED, true); purged = true; - } catch (MessageRemovedException ignored) { + } catch (MessagingException ignored) { Log.w(name + " existing gone uid=" + muid + " for msgid=" + msgid); } } + if (purged) - ifolder.expunge(); + try { + ifolder.expunge(); + } catch (MessagingException ex) { + // NO EXPUNGE failed. + Log.e(ex); + } } } @@ -1336,7 +1342,7 @@ class Core { } if (deleted) - ifolder.expunge(); + ifolder.expunge(); // NO EXPUNGE failed. db.message().deleteMessage(message.id); } finally {