diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Quota.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Quota.php new file mode 100644 index 000000000..9915d751b --- /dev/null +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Quota.php @@ -0,0 +1,48 @@ +IsSupported('QUOTA') + ? $this->SendRequestGetResponse("GETQUOTA {$this->EscapeString($sRootName)}")->getQuotaResult() + : null; + } + + /** + * https://datatracker.ietf.org/doc/html/rfc2087#section-4.3 + * + * @throws \MailSo\Net\Exceptions\Exception + * @throws \MailSo\Imap\Exceptions\Exception + */ + public function QuotaRoot(string $sFolderName = 'INBOX') : ?array + { + return $this->IsSupported('QUOTA') + ? $this->SendRequestGetResponse("GETQUOTAROOT {$this->EscapeString($sFolderName)}")->getQuotaResult() + : null; + } +} 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 2012fbb19..5abf705ae 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 @@ -20,6 +20,7 @@ class ImapClient extends \MailSo\Net\NetClient use Traits\ResponseParser; // use Commands\ACL; use Commands\Metadata; + use Commands\Quota; const TAG_PREFIX = 'TAG'; @@ -739,38 +740,6 @@ class ImapClient extends \MailSo\Net\NetClient return $oResult->getFetchResult($this->oLogger); } - /** - * https://datatracker.ietf.org/doc/html/rfc2087#section-4.2 - * - * @throws \MailSo\Net\Exceptions\Exception - * @throws \MailSo\Imap\Exceptions\Exception - */ - public function Quota(string $sRootName = '') : ?array - { - if ($this->IsSupported('QUOTA')) - { - return $this->SendRequestGetResponse("GETQUOTA {$this->EscapeString($sRootName)}")->getQuotaResult(); - } - - return null; - } - - /** - * https://datatracker.ietf.org/doc/html/rfc2087#section-4.3 - * - * @throws \MailSo\Net\Exceptions\Exception - * @throws \MailSo\Imap\Exceptions\Exception - */ - public function QuotaRoot(string $sFolderName = 'INBOX') : ?array - { - if ($this->IsSupported('QUOTA')) - { - return $this->SendRequestGetResponse("GETQUOTAROOT {$this->EscapeString($sFolderName)}")->getQuotaResult(); - } - - return null; - } - /** * See https://tools.ietf.org/html/rfc5256 * @throws \MailSo\Base\Exceptions\InvalidArgumentException @@ -1200,6 +1169,7 @@ class ImapClient extends \MailSo\Net\NetClient } /** + * RFC 2971 * Don't have to be logged in to call this command */ public function ServerID() : string