Skip to content
Snippets Groups Projects
Commit 3e8b5f83 authored by jmechnich's avatar jmechnich
Browse files

ignore folders which cause errors on access

parent ffe595ef
No related branches found
No related tags found
No related merge requests found
......@@ -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'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment