From a7194b74b95c2d2181bba5f5bafd8d9a0832e12e Mon Sep 17 00:00:00 2001 From: djmaze Date: Wed, 27 Oct 2021 19:42:09 +0200 Subject: [PATCH] Added RFC 2971 --- .../app/libraries/MailSo/Imap/ImapClient.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index a009b1e0b..c5e31dcc4 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -1810,6 +1810,26 @@ class ImapClient extends \MailSo\Net\NetClient return $this->SendRequestGetResponse('GETMETADATA', $arguments)->getFolderMetadataResult(); } + /** + * Don't have to be logged in to call this command + */ + public function ServerID() : string + { + if ($this->IsSupported('ID')) { + foreach ($this->SendRequestGetResponse('ID', [null]) as $oResponse) { + if ('ID' === $oResponse->ResponseList[1] && \is_array($oResponse->ResponseList[2])) { + $c = \count($oResponse->ResponseList[2]); + $aResult = []; + for ($i = 0; $i < $c; $i += 2) { + $aResult[] = $oResponse->ResponseList[2][$i] . '=' . $oResponse->ResponseList[2][$i+1]; + } + return \implode(' ', $aResult); + } + } + } + return 'UNKNOWN'; + } + public function ServerGetMetadata(array $aEntries, array $aOptions = []) : array { return $this->IsSupported('METADATA-SERVER')