Resolve #155 Office365 lacks IMAP features

This commit is contained in:
djmaze 2021-10-29 23:43:32 +02:00
parent 9db640c6c5
commit d4117dc723

View file

@ -418,17 +418,20 @@ class ImapClient extends \MailSo\Net\NetClient
{ {
$oFolderInfo = $this->oCurrentFolderInfo; $oFolderInfo = $this->oCurrentFolderInfo;
if ($oFolderInfo && $sFolderName === $oFolderInfo->FolderName) { if ($oFolderInfo && $sFolderName === $oFolderInfo->FolderName) {
// Not supported by Outlook/Hotmail/Office365
if ($this->IsSupported('ESEARCH')) {
$aResult = $oFolderInfo->getStatusItems(); $aResult = $oFolderInfo->getStatusItems();
// SELECT or EXAMINE command then UNSEEN is the message sequence number of the first unseen message // SELECT or EXAMINE command then UNSEEN is the message sequence number of the first unseen message
$aResult['UNSEEN'] = $this->simpleESearchOrESortHelper(false, 'UNSEEN', ['COUNT'])['COUNT']; $aResult['UNSEEN'] = $this->simpleESearchOrESortHelper(false, 'UNSEEN', ['COUNT'])['COUNT'];
} else { return $aResult;
$aResult = \count($aStatusItems) }
// $this->FolderUnSelect();
}
return \count($aStatusItems)
? $this->SendRequestGetResponse('STATUS', array($this->EscapeString($sFolderName), $aStatusItems)) ? $this->SendRequestGetResponse('STATUS', array($this->EscapeString($sFolderName), $aStatusItems))
->getStatusFolderInformationResult() ->getStatusFolderInformationResult()
: null; : null;
} }
return $aResult;
}
/** /**
* @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Net\Exceptions\Exception