diff options
author | jmechnich <joerg.mechnich@gmail.com> | 2021-01-07 21:09:04 +0300 |
---|---|---|
committer | jmechnich <joerg.mechnich@gmail.com> | 2021-01-18 15:54:54 +0300 |
commit | 3e8b5f8301c66311c6dc9bb1086147b66b5c51e3 (patch) | |
tree | aa4d966478257c45b0aaa70c4967566b70bb7aa3 /lib/IMAP | |
parent | ffe595ef223af5fb95e287dabeae2b426691fdb1 (diff) |
ignore folders which cause errors on access
Signed-off-by: jmechnich <joerg.mechnich@gmail.com>
Diffstat (limited to 'lib/IMAP')
-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'], |