mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
Merge pull request #2081 from the-djmaze/rainloop-issue2037
Resolve issue #2037
This commit is contained in:
commit
e5659da4e8
1 changed files with 19 additions and 2 deletions
|
@ -664,11 +664,28 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
foreach ($aResult as /* @var $oImapResponse \MailSo\Imap\Response */ $oImapResponse)
|
||||
{
|
||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType &&
|
||||
$sStatus === $oImapResponse->StatusOrIndex && 5 === count($oImapResponse->ResponseList))
|
||||
$sStatus === $oImapResponse->StatusOrIndex && 5 <= count($oImapResponse->ResponseList))
|
||||
{
|
||||
try
|
||||
{
|
||||
$oFolder = Folder::NewInstance($oImapResponse->ResponseList[4],
|
||||
/**
|
||||
* A bug in the parser converts folder names that start with '[' into arrays,
|
||||
* and subfolders are in $oResponse->ResponseList[5+]
|
||||
* https://github.com/the-djmaze/snappymail/issues/1
|
||||
* https://github.com/the-djmaze/snappymail/issues/70
|
||||
* https://github.com/RainLoop/rainloop-webmail/issues/2037
|
||||
*/
|
||||
$sFullNameRaw = \array_slice($oResponse->ResponseList, 4);
|
||||
foreach ($sFullNameRaw as &$name) {
|
||||
if (\is_array($name)) {
|
||||
$name = "[{$name[0]}]";
|
||||
} else if (!\is_string($name)) {
|
||||
$name = '';
|
||||
}
|
||||
}
|
||||
$sFullNameRaw = \implode('', $sFullNameRaw);
|
||||
|
||||
$oFolder = Folder::NewInstance($sFullNameRaw,
|
||||
$oImapResponse->ResponseList[3], $oImapResponse->ResponseList[2]);
|
||||
|
||||
if ($oFolder->IsInbox())
|
||||
|
|
Loading…
Reference in a new issue