Support for the QUOTA extension is broken in several ways: it assumes STORAGE is the only possible quota resource type (which was not true, even for RFC2087) and the response parser will crash the connection if multiple resource types are returned. Fixing this is backward incompatible, so it will need to be hidden behind new config attribute.
Response Parser
Currently, the response parser for quota-response only allows zero or one quota-resource. It implicitly assumes that resource type is STORAGE, so it doesn't store the resource type. And it crashes for more than one resource type.
Response Data
MailboxQuota must be deprecated: the #mailbox attribute is misleadingly named (it should be #quota_root), the class is misleadingly named (again: it provides information about a "quota root", which does not have a 1-to-1 relationship with mailbox), and it can only list usage and limit for a single resource type
Net::IMAP command methods
Additional
Separately from this bug, there are some other QUOTA related issues (TODO: move these to separate issues/PRs):
Support for the
QUOTAextension is broken in several ways: it assumesSTORAGEis the only possible quota resource type (which was not true, even for RFC2087) and the response parser will crash the connection if multiple resource types are returned. Fixing this is backward incompatible, so it will need to be hidden behind new config attribute.Response Parser
Currently, the response parser for
quota-responseonly allows zero or onequota-resource. It implicitly assumes that resource type isSTORAGE, so it doesn't store the resource type. And it crashes for more than one resource type.QUOTAresponse should be parsed consistently withRFC2087andRFC9208, into a newQuotaResponsetype.Response Data
MailboxQuotamust be deprecated: the#mailboxattribute is misleadingly named (it should be#quota_root), the class is misleadingly named (again: it provides information about a "quota root", which does not have a 1-to-1 relationship with mailbox), and it can only list usage and limit for a single resource typeQuotaResponse = Data.define(:quota_root, :resources)#to_deprecated_mailbox_quotafor backwards compatibilityQuotaResponse::Resource = Data.define(:name, :usage, :limit)Net::IMAP command methods
#getquota: Useuse_deprecated_mailbox_quotaconfig::silent, return only theSTORAGEresource (nilif noSTORAGEresource)true, same as:silentbut issue a warning for nonSTORAGEresource typesfalse, returnQuotaResponserather thanMailboxQuota#getquotaroot: Useuse_deprecated_mailbox_quotaconfig (same as#getquota)#setquota: support any number of any resource types via*restargsAdditional
Separately from this bug, there are some other
QUOTArelated issues (TODO: move these to separate issues/PRs):QUOTA=RES-*andQUOTASETQuotaResponse: Add accessors "attributes" for every type in the IANA quota resource type registry:def storage = resources.find { "STORAGE".casecmp?(it.name) }def message = resources.find { "MESSAGE".casecmp?(it.name) }def mailbox = resources.find { "MAILBOX".casecmp?(it.name) }def annotation_storage = resources.find { "ANNOTATION-STORAGE".casecmp?(it.name) }OVERQUOTAResponseCodeclass#setquota:#getquotaroot:MailboxQuotaRootandQuotaResponseobjects, return a single hash-like object that combines them.Config#getquotaroot_returns_quotaroot_dataConfig#setquota_returns_quota_responses=> return matching untaggedQUOTAresponses