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:
authorPatrick Bender <patrick@bender-it-services.de>2020-10-07 15:05:19 +0300
committerPatrick Bender <patrick@bender-it-services.de>2020-10-14 20:15:23 +0300
commit94e1ca8eb229bc7eeffaf6b83dc5e3f3a7c84d66 (patch)
treea04668c585a281762b9f0e18d37335cd73430aae /lib/IMAP
parentf264809b8c7b47223de8974e8abdf7be61aa6771 (diff)
Catch mailbox does not support mod-sequences error and force a full sync if it occurs
Signed-off-by: Patrick Bender <patrick@bender-it-services.de>
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);