Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/IMAP
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-10-14 21:08:18 +0300
committerGitHub <noreply@github.com>2020-10-14 21:08:18 +0300
commitf9d117989fd2e11d81f247c889defea4d4ab9e70 (patch)
tree01c28a43cd4048f0ce7f00f396b7aafb09acec5a /lib/IMAP
parent02ca8fd3d76c9597a73b2fb9d51bc7615d867b40 (diff)
parent94e1ca8eb229bc7eeffaf6b83dc5e3f3a7c84d66 (diff)
Merge pull request #3560 from IchbinkeinReh/fix-mailbox-does-not-support-mod-sequences
Catch more errors in sync function to recover from "Mailbox does not support mod-sequences" error on partial sync
Diffstat (limited to 'lib/IMAP')
-rw-r--r--lib/IMAP/Sync/Synchronizer.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/IMAP/Sync/Synchronizer.php b/lib/IMAP/Sync/Synchronizer.php
index 8145d3b1b..962a9af5e 100644
--- a/lib/IMAP/Sync/Synchronizer.php
+++ b/lib/IMAP/Sync/Synchronizer.php
@@ -30,6 +30,7 @@ use Horde_Imap_Client_Exception_Sync;
use Horde_Imap_Client_Ids;
use Horde_Imap_Client_Mailbox;
use OCA\Mail\Exception\UidValidityChangedException;
+use OCA\Mail\Exception\MailboxDoesNotSupportModSequencesException;
use OCA\Mail\IMAP\MessageMapper;
use function array_chunk;
use function array_merge;
@@ -53,6 +54,7 @@ class Synchronizer {
* @throws Horde_Imap_Client_Exception
* @throws Horde_Imap_Client_Exception_Sync
* @throws UidValidityChangedException
+ * @throws MailboxDoesNotSupportModSequencesException
*/
public function sync(Horde_Imap_Client_Base $imapClient,
Request $request,
@@ -79,6 +81,11 @@ class Synchronizer {
throw new UidValidityChangedException();
}
throw $e;
+ } catch (Horde_Imap_Client_Exception $e) {
+ if ($e->getCode() === Horde_Imap_Client_Exception::MBOXNOMODSEQ) {
+ throw new MailboxDoesNotSupportModSequencesException($e->getMessage(), $e->getCode(), $e);
+ }
+ throw $e;
}
$newMessages = $this->messageMapper->findByIds($imapClient, $request->getMailbox(), $newUids);