🐛 `QUOTA` support is broken for types other than `STORAGE`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 118
- Forks
- 43
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 26
Description
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.
-
QUOTAresponse should be parsed consistently withRFC2087andRFC9208, into a newQuotaResponsetype.
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
-
QuotaResponse = Data.define(:quota_root, :resources)-
#to_deprecated_mailbox_quotafor backwards compatibility
-
-
QuotaResponse::Resource = Data.define(:name, :usage, :limit)
Net::IMAP command methods
-
#getquota: Useuse_deprecated_mailbox_quotaconfig:- when
:silent, return only theSTORAGEresource (nilif noSTORAGEresource) - when
true, same as:silentbut issue a warning for nonSTORAGEresource types - when
false, returnQuotaResponserather thanMailboxQuota
- when
-
#getquotaroot: Useuse_deprecated_mailbox_quotaconfig (same as#getquota) -
#setquota: support any number of any resource types via*restargs
Additional
Separately from this bug, there are some other QUOTA related issues (TODO: move these to separate issues/PRs):
- RFC9208 support
- new capabilities:
QUOTA=RES-*andQUOTASET- document at class level, and on all three quota methods
-
QuotaResponse: 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) }
-
- new response code:
OVERQUOTA- document on
ResponseCodeclass - add (trivial) support in response parser
- document on
-
#setquota:- support IANA-registered resource types via keyword args
- new capabilities:
-
#getquotaroot:- Rather than return an array of mixed
MailboxQuotaRootandQuotaResponseobjects, return a single hash-like object that combines them.-
Config#getquotaroot_returns_quotaroot_data
-
-
Config#setquota_returns_quota_responses=> return matching untaggedQUOTAresponses
- Rather than return an array of mixed
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the quota-response parser and the Net::IMAP #getquota, #getquotaroot, and #setquota entry points, using RFC2087 and RFC9208 as the protocol references. Done means multiple resource types parse without crashing, QuotaResponse and backward-compatible behavior are supported through configuration, and quota setting accepts the requested resource types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100