Fix mail shows empty mailboxes for some specific mail servers

This commit is contained in:
Hadi Nategh 2017-05-19 15:56:48 +02:00
parent bd0530cc72
commit b1f46d8189

View File

@ -1885,6 +1885,12 @@ class Mail
{ {
$sortResult = $this->icServer->search($_folderName, $filter, array( $sortResult = $this->icServer->search($_folderName, $filter, array(
'sort' => $sortOrder,)); 'sort' => $sortOrder,));
// Attempt another search without sorting filter if first try failed with
// no result, as may some servers do not coupe well with sort option
// eventhough they claim to support SORT capability.
if (!isset($sortResult['count'])) $sortResult = $this->icServer->search($_folderName, $filter);
// if there is an Error, we assume that the server is not capable of sorting // if there is an Error, we assume that the server is not capable of sorting
} }
catch(\Exception $e) catch(\Exception $e)