Bugfix: message flags/keywords are 'atom' and should be Utf7 modified

This commit is contained in:
the-djmaze 2022-05-31 23:53:57 +02:00
parent 3fc781c1c1
commit e8b73b4943
4 changed files with 6 additions and 4 deletions

View file

@ -333,7 +333,7 @@ trait Folders
$key = $oResponse->OptionalResponse[0]; $key = $oResponse->OptionalResponse[0];
if (\count($oResponse->OptionalResponse) > 1) { if (\count($oResponse->OptionalResponse) > 1) {
if ('PERMANENTFLAGS' === $key && \is_array($oResponse->OptionalResponse[1])) { if ('PERMANENTFLAGS' === $key && \is_array($oResponse->OptionalResponse[1])) {
$oResult->PermanentFlags = $oResponse->OptionalResponse[1]; $oResult->PermanentFlags = \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $oResponse->OptionalResponse[1]);
} }
} else if ('READ-ONLY' === $key) { } else if ('READ-ONLY' === $key) {
// $oResult->IsWritable = false; // $oResult->IsWritable = false;
@ -348,7 +348,7 @@ trait Folders
else if (\count($oResponse->ResponseList) > 2 else if (\count($oResponse->ResponseList) > 2
&& 'FLAGS' === $oResponse->ResponseList[1] && 'FLAGS' === $oResponse->ResponseList[1]
&& \is_array($oResponse->ResponseList[2])) { && \is_array($oResponse->ResponseList[2])) {
$oResult->Flags = $oResponse->ResponseList[2]; $oResult->Flags = \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $oResponse->ResponseList[2]);
} }
} }
} }

View file

@ -279,6 +279,8 @@ trait Messages
* $sStoreAction[] = (UNCHANGEDSINCE $modsequence) * $sStoreAction[] = (UNCHANGEDSINCE $modsequence)
*/ */
$aInputStoreItems = \array_map('\\MailSo\\Base\\Utils::Utf8ToUtf7Modified', $aInputStoreItems);
return $this->SendRequestGetResponse( return $this->SendRequestGetResponse(
$oRange->UID ? 'UID STORE' : 'STORE', $oRange->UID ? 'UID STORE' : 'STORE',
array((string) $oRange, $sStoreAction, $aInputStoreItems) array((string) $oRange, $sStoreAction, $aInputStoreItems)

View file

@ -535,7 +535,7 @@ class MailClient
foreach ($aFetchResponse as $oFetchResponse) { foreach ($aFetchResponse as $oFetchResponse) {
$iUid = (int) $oFetchResponse->GetFetchValue(FetchType::UID); $iUid = (int) $oFetchResponse->GetFetchValue(FetchType::UID);
$aLowerFlags = \array_map('strtolower', $oFetchResponse->GetFetchValue(FetchType::FLAGS)); $aLowerFlags = \array_map('mb_strtolower', \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $oFetchResponse->GetFetchValue(FetchType::FLAGS)));
$aFlags[] = array( $aFlags[] = array(
'Uid' => $iUid, 'Uid' => $iUid,
'Flags' => $aLowerFlags 'Flags' => $aLowerFlags

View file

@ -293,7 +293,7 @@ class Message implements \JsonSerializable
$oMessage->sFolder = $sFolder; $oMessage->sFolder = $sFolder;
$oMessage->iUid = (int) $oFetchResponse->GetFetchValue(FetchType::UID); $oMessage->iUid = (int) $oFetchResponse->GetFetchValue(FetchType::UID);
$oMessage->iSize = (int) $oFetchResponse->GetFetchValue(FetchType::RFC822_SIZE); $oMessage->iSize = (int) $oFetchResponse->GetFetchValue(FetchType::RFC822_SIZE);
$oMessage->aFlagsLowerCase = \array_map('strtolower', $aFlags ?: []); $oMessage->aFlagsLowerCase = \array_map('mb_strtolower', \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $aFlags ?: []));
$oMessage->iInternalTimeStampInUTC = $oMessage->iInternalTimeStampInUTC =
\MailSo\Base\DateTimeHelper::ParseInternalDateString($sInternalDate); \MailSo\Base\DateTimeHelper::ParseInternalDateString($sInternalDate);