From 1c240031bf3abfc9db3739fb24ab826f4cdaa4c8 Mon Sep 17 00:00:00 2001 From: Trogel Date: Fri, 22 Sep 2017 22:18:01 +0200 Subject: [PATCH 1/2] Connect read-only for poll --- .../main/java/com/fsck/k9/controller/MessagingController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java index 92bb8e9d1..54e81f819 100644 --- a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java +++ b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java @@ -801,11 +801,11 @@ public class MessagingController { */ Timber.v("SYNC: About to open remote folder %s", folder); - remoteFolder.open(Folder.OPEN_MODE_RW); if (Expunge.EXPUNGE_ON_POLL == account.getExpungePolicy()) { Timber.d("SYNC: Expunging folder %s:%s", account.getDescription(), folder); remoteFolder.expunge(); } + remoteFolder.open(Folder.OPEN_MODE_RO); } From 7107a606ac5e1322c6af86a3e8a59cda25aa01a1 Mon Sep 17 00:00:00 2001 From: Trogel Date: Fri, 29 Sep 2017 22:19:16 +0200 Subject: [PATCH 2/2] Adjust test for read-only connection for polling --- .../java/com/fsck/k9/controller/MessagingControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k9mail/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java b/k9mail/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java index a01436f50..011a8556e 100644 --- a/k9mail/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java +++ b/k9mail/src/test/java/com/fsck/k9/controller/MessagingControllerTest.java @@ -661,7 +661,7 @@ public class MessagingControllerTest { controller.synchronizeMailboxSynchronous(account, FOLDER_NAME, listener, null); - verify(remoteFolder).open(Folder.OPEN_MODE_RW); + verify(remoteFolder).open(Folder.OPEN_MODE_RO); } @Test