diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-02-19 12:35:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 12:35:58 +0300 |
commit | eda356f3d264cffc7ae4a42ffe6528a6ba01a5cc (patch) | |
tree | a32df9771bafd69e018a9afcdcedcdd7ae0282fb /lib | |
parent | f36681c7a1a1f26dd8de275c353583a05b52bd9d (diff) | |
parent | 3e8b5f8301c66311c6dc9bb1086147b66b5c51e3 (diff) |
Merge pull request #4318 from jmechnich/fix-for-unreadable-mailboxes
ignore folders which cause errors on access
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IMAP/FolderMapper.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/IMAP/FolderMapper.php b/lib/IMAP/FolderMapper.php index b40d5abeb..f12ea3af8 100644 --- a/lib/IMAP/FolderMapper.php +++ b/lib/IMAP/FolderMapper.php @@ -62,12 +62,24 @@ class FolderMapper { 'special_use' => true, ]); - return array_filter(array_map(function (array $mailbox) use ($account) { + return array_filter(array_map(function (array $mailbox) use ($account, $client) { if (in_array($mailbox['mailbox']->utf8, self::DOVECOT_SIEVE_FOLDERS, true)) { // This is a special folder that must not be shown return null; } + try { + $client->status($mailbox["mailbox"]); + } catch (Horde_Imap_Client_Exception $e) { + // ignore folders which cause errors on access + // (i.e. server-side system I/O errors) + if (in_array($e->getCode(), [ + Horde_Imap_Client_Exception::UNSPECIFIED, + ], true)) { + return null; + } + } + return new Folder( $account->getId(), $mailbox['mailbox'], |