diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index f25f9536bf..2cce3a1b44 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -845,6 +845,8 @@ public class ServiceSynchronize extends LifecycleService { } catch (Throwable ex) { Log.e(folder.name, ex); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); + } finally { + ((IMAPMessage) imessage).invalidateHeaders(); } int count = ifolder.getMessageCount(); @@ -876,6 +878,8 @@ public class ServiceSynchronize extends LifecycleService { Log.i(folder.name + " deleted uid=" + uid + " count=" + count); } catch (MessageRemovedException ex) { Log.w(folder.name, ex); + } finally { + ((IMAPMessage) imessage).invalidateHeaders(); } int count = ifolder.getMessageCount(); @@ -933,6 +937,8 @@ public class ServiceSynchronize extends LifecycleService { } catch (Throwable ex) { Log.e(folder.name, ex); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); + } finally { + ((IMAPMessage) e.getMessage()).invalidateHeaders(); } } catch (Throwable ex) { Log.e(folder.name, ex);