From 9d7f93f304c2608952c451391618b1c7eb54757e Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Fri, 8 Dec 2023 21:44:25 +0100 Subject: [PATCH] Resolve #1354 --- .../v/0.0.0/app/libraries/MailSo/Imap/Commands/ACL.php | 10 +++++----- .../app/libraries/MailSo/Imap/Commands/Folders.php | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/ACL.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/ACL.php index e3043f296..6cd6ce4bb 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/ACL.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/ACL.php @@ -72,7 +72,7 @@ trait ACL { // if ($this->ACLAllow($sFolderName, 'SETACL')) { $this->SendRequestGetResponse('SETACL', array( - $this->EscapeString($sFolderName), + $this->EscapeFolderName($sFolderName), $this->EscapeString($sIdentifier), $this->EscapeString($sAccessRights) )); @@ -82,7 +82,7 @@ trait ACL { // if ($this->ACLAllow($sFolderName, 'DELETEACL')) { $this->SendRequestGetResponse('DELETEACL', array( - $this->EscapeString($sFolderName), + $this->EscapeFolderName($sFolderName), $this->EscapeString($sIdentifier) )); } @@ -90,7 +90,7 @@ trait ACL public function FolderGetACL(string $sFolderName) : array { // if ($this->ACLAllow($sFolderName, 'GETACL')) { - $oResponses = $this->SendRequestGetResponse('GETACL', array($this->EscapeString($sFolderName))); + $oResponses = $this->SendRequestGetResponse('GETACL', array($this->EscapeFolderName($sFolderName))); $aResult = array(); foreach ($oResponses as $oResponse) { if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oResponse->ResponseType @@ -109,7 +109,7 @@ trait ACL { // if ($this->ACLAllow($sFolderName, 'LISTRIGHTS')) { $oResponses = $this->SendRequestGetResponse('LISTRIGHTS', array( - $this->EscapeString($sFolderName), + $this->EscapeFolderName($sFolderName), $this->EscapeString($sIdentifier) )); foreach ($oResponses as $oResponse) { @@ -130,7 +130,7 @@ trait ACL { // if ($this->ACLAllow($sFolderName, 'MYRIGHTS')) { // if ($this->hasCapability('ACL')) { - $oResponses = $this->SendRequestGetResponse('MYRIGHTS', array($this->EscapeString($sFolderName))); + $oResponses = $this->SendRequestGetResponse('MYRIGHTS', array($this->EscapeFolderName($sFolderName))); foreach ($oResponses as $oResponse) { if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oResponse->ResponseType && isset($oResponse->ResponseList[3]) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php index b27ae02d5..d79f49116 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php @@ -565,7 +565,7 @@ trait Folders if ($bMetadata && !$aMetadata /*&& 50 < $oFolderCollection->count()*/) { foreach ($oFolderCollection as $oFolder) { // if (2 > \substr_count($oFolder->FullName, $oFolder->Delimiter())) - try { + if ($oFolder->Selectable()) try { $oFolder->SetAllMetadata( $this->getMetadata($oFolder->FullName, ['/shared', '/private'], ['DEPTH'=>'infinity']) ); @@ -577,7 +577,11 @@ trait Folders if ($this->hasCapability('ACL') || $this->CapabilityValue('RIGHTS')) { foreach ($oFolderCollection as $oFolder) { - $oFolder->myRights = $this->FolderMyRights($oFolder->FullName); + if ($oFolder->Selectable()) try { + $oFolder->myRights = $this->FolderMyRights($oFolder->FullName); + } catch (\Throwable $oException) { + // Ignore error + } } }