idnits 2.17.1 draft-ietf-extra-quota-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The abstract seems to indicate that this document obsoletes RFC9051, but the header doesn't have an 'Obsoletes:' line to match this. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (18 November 2021) is 889 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 3501 (Obsoleted by RFC 9051) ** Downref: Normative reference to an Experimental RFC: RFC 5257 -- Obsolete informational reference (is this intentional?): RFC 2087 (Obsoleted by RFC 9208) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Melnikov 3 Internet-Draft Isode 4 Obsoletes: 2087 (if approved) 18 November 2021 5 Intended status: Standards Track 6 Expires: 22 May 2022 8 IMAP QUOTA Extension 9 draft-ietf-extra-quota-10 11 Abstract 13 This document defines a QUOTA extension of the Internet Message 14 Access Protocol (RFC 3501/RFC 9051) that permits administrative 15 limits on resource usage (quotas) to be manipulated through the IMAP 16 protocol. 18 This document obsoletes RFC 2087, but attempts to remain backwards 19 compatible whenever possible. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at https://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on 22 May 2022. 38 Copyright Notice 40 Copyright (c) 2021 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 45 license-info) in effect on the date of publication of this document. 46 Please review these documents carefully, as they describe your rights 47 and restrictions with respect to this document. Code Components 48 extracted from this document must include Simplified BSD License text 49 as described in Section 4.e of the Trust Legal Provisions and are 50 provided without warranty as described in the Simplified BSD License. 52 This document may contain material from IETF Documents or IETF 53 Contributions published or made publicly available before November 54 10, 2008. The person(s) controlling the copyright in some of this 55 material may not have granted the IETF Trust the right to allow 56 modifications of such material outside the IETF Standards Process. 57 Without obtaining an adequate license from the person(s) controlling 58 the copyright in such materials, this document may not be modified 59 outside the IETF Standards Process, and derivative works of it may 60 not be created outside the IETF Standards Process, except to format 61 it for publication as an RFC or to translate it into languages other 62 than English. 64 Table of Contents 66 1. Document Conventions . . . . . . . . . . . . . . . . . . . . 3 67 2. Introduction and Overview . . . . . . . . . . . . . . . . . . 3 68 3. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 3.1. Resource . . . . . . . . . . . . . . . . . . . . . . . . 4 70 3.1.1. Name . . . . . . . . . . . . . . . . . . . . . . . . 4 71 3.1.2. Definition . . . . . . . . . . . . . . . . . . . . . 4 72 3.2. Quota Root . . . . . . . . . . . . . . . . . . . . . . . 5 73 4. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 6 74 4.1. Commands . . . . . . . . . . . . . . . . . . . . . . . . 6 75 4.1.1. GETQUOTA . . . . . . . . . . . . . . . . . . . . . . 6 76 4.1.2. GETQUOTAROOT . . . . . . . . . . . . . . . . . . . . 7 77 4.1.3. SETQUOTA . . . . . . . . . . . . . . . . . . . . . . 7 78 4.1.4. New STATUS attributes . . . . . . . . . . . . . . . . 9 79 4.2. Responses . . . . . . . . . . . . . . . . . . . . . . . . 10 80 4.2.1. QUOTA . . . . . . . . . . . . . . . . . . . . . . . . 10 81 4.2.2. QUOTAROOT . . . . . . . . . . . . . . . . . . . . . . 10 82 4.3. Response Codes . . . . . . . . . . . . . . . . . . . . . 10 83 4.3.1. OVERQUOTA . . . . . . . . . . . . . . . . . . . . . . 11 84 5. Resource Type Definitions . . . . . . . . . . . . . . . . . . 12 85 5.1. STORAGE . . . . . . . . . . . . . . . . . . . . . . . . . 12 86 5.2. MESSAGE . . . . . . . . . . . . . . . . . . . . . . . . . 13 87 5.3. MAILBOX . . . . . . . . . . . . . . . . . . . . . . . . . 13 88 5.4. ANNOTATION-STORAGE . . . . . . . . . . . . . . . . . . . 13 89 6. Interaction with IMAP ACL extension (RFC 4314) . . . . . . . 14 90 7. Formal syntax . . . . . . . . . . . . . . . . . . . . . . . . 14 91 8. Security Considerations . . . . . . . . . . . . . . . . . . . 16 92 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 93 9.1. Changes/additions to the IMAP4 capabilities registry . . 17 94 9.2. IMAP quota resource type registry . . . . . . . . . . . . 17 95 9.3. Registrations of IMAP Quota Resource Types . . . . . . . 18 96 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 19 97 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 19 98 12. Changes since RFC 2087 . . . . . . . . . . . . . . . . . . . 20 99 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 100 13.1. Normative References . . . . . . . . . . . . . . . . . . 20 101 13.2. Informative References . . . . . . . . . . . . . . . . . 21 102 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 21 104 1. Document Conventions 106 In protocol examples, this document uses a prefix of "C: " to denote 107 lines sent by the client to the server, and "S: " for lines sent by 108 the server to the client. Lines prefixed with "// " are comments 109 explaining the previous protocol line. These prefixes and comments 110 are not part of the protocol. Lines without any of these prefixes 111 are continuations of the previous line, and no line break is present 112 in the protocol before such lines unless specifically mentioned. 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 116 "OPTIONAL" in this document are to be interpreted as described in BCP 117 14 [RFC2119] [RFC8174] when, and only when, they appear in all 118 capitals, as shown here. 120 Other capitalised words are IMAP keywords [RFC3501][RFC9051] or 121 keywords from this document. 123 2. Introduction and Overview 125 This document defines a couple of extensions to the Internet Message 126 Access Protocol [RFC3501] for querying and manipulating 127 administrative limits on resource usage (quotas). This extension is 128 compatible with both IMAP4rev1 [RFC3501] and IMAP4rev2 [RFC9051]. 130 The capability "QUOTA", denotes a RFC2087 [RFC2087] compliant server. 131 Some responses and response codes defined in this document are not 132 present in such servers (see Section 12 for more details), and 133 clients MUST NOT rely on their presence in the absence of any 134 capability beginning with "QUOTA=". 136 Any server compliant with this document MUST also return at least one 137 capability starting with "QUOTA=RES-" prefix, as described in 138 Section 3.1. 140 Any server compliant with this document that implements the SETQUOTA 141 command (see Section 4.1.3) MUST also return the "QUOTASET" 142 capability. 144 This document also reserves all other capabilities starting with 145 "QUOTA=" prefix for future IETF stream standard track, informational 146 or experimental extensions to this document. 148 Quotas can be used to restrict clients for administrative reasons, 149 but the QUOTA extension can also be used to indicate system limits 150 and current usage levels to clients. 152 Although RFC2087 [RFC2087] specified an IMAP4 QUOTA extension, and 153 this has seen deployment in servers, it has seen little deployment in 154 clients. Since the meaning of the resources was left implementation- 155 dependent, it was impossible for a client implementation to determine 156 which resources were supported, and impossible to determine which 157 mailboxes were in a given quota root (see Section 3.2), without a 158 priori knowledge of the implementation. 160 3. Terms 162 3.1. Resource 164 A resource has a name, a formal definition. 166 3.1.1. Name 168 The resource name is an atom, as defined in IMAP4rev1 [RFC3501]. 169 These MUST be registered with IANA. 171 Supported resource names MUST be advertised as a capability, by 172 prepending the resource name with "QUOTA=RES-". A server compliant 173 with this specification is not required to support all reported 174 resource types on all quota roots. 176 3.1.2. Definition 178 The resource definition or document containing it, while not visible 179 through the protocol, SHOULD be registered with IANA. 181 The usage of a resource MUST be represented as a 63 bit unsigned 182 integer. 0 indicates that the resource is exhausted. Usage integers 183 don't necessarily represent proportional use, so clients MUST NOT 184 compare available resource between two separate quota roots on the 185 same or different servers. 187 Limits will be specified as, and MUST be represented as, an integer. 188 0 indicates that any usage is prohibited. 190 Limits may be hard or soft - that is, an implementation MAY choose, 191 or be configured, to disallow any command if the limit on a resource 192 is or would be exceeded. 194 All resources which the server handles MUST be advertised in a 195 CAPABILITY response/response code consisting of the resource name 196 prefixed by "QUOTA=RES-". 198 The resources STORAGE (Section 5.1), MESSAGE (Section 5.2), MAILBOX 199 (Section 5.3) and ANNOTATION-STORAGE (Section 5.4) are defined in 200 this document. 202 3.2. Quota Root 204 This document introduces a concept of a "quota root", as resource 205 limits can apply across multiple IMAP mailboxes. 207 Each mailbox has zero or more implementation-defined named "quota 208 roots". Each quota root has zero or more resource limits (quotas). 209 All mailboxes that share the same named quota root share the resource 210 limits of the quota root. 212 Quota root names need not be mailbox names, nor is there any 213 relationship defined by this document between a quota root name and a 214 mailbox name. A quota root name is an astring, as defined in IMAP4 215 [RFC3501]. It SHOULD be treated as an opaque string by any clients. 217 Quota roots are used since not all implementations may be able to 218 calculate usage, or apply quotas, on arbitrary mailboxes or mailbox 219 hierarchies. 221 Not all resources may be limitable or calculable for all quota roots. 222 Further, not all resources may support all limits - some limits may 223 be present in the underlying system. A server implementation of this 224 memo SHOULD advise the client of such inherent limits, by generating 225 QUOTA (Section 4.2.1) responses, and SHOULD advise the client of 226 which resources are limitable for a particular quota root. A 227 SETQUOTA (Section 4.1.3) command MAY also round a quota limit in an 228 implementation-dependent way, if the granularity of the underlying 229 system demands it. A client MUST be prepared for a SETQUOTA 230 (Section 4.1.3) command to fail if a limit cannot be set. 232 Implementation Notes: This means that, for example under UNIX, a 233 quota root may have a MESSAGE (Section 5.2) quota always set due to 234 the number of inodes available on the filesystem, and similarly 235 STORAGE (Section 5.1) may be rounded to the nearest block and limited 236 by free filesystem space. 238 4. Definitions 240 4.1. Commands 242 The following commands exist for manipulation and querying quotas. 244 4.1.1. GETQUOTA 246 Arguments: quota root 248 Responses: REQUIRED untagged responses: QUOTA 250 Result: OK - getquota completed 252 NO - getquota error: no such quota root, permission denied 254 BAD - command unknown or arguments invalid 256 The GETQUOTA command takes the name of a quota root and returns the 257 quota root's resource usage and limits in an untagged QUOTA response. 258 (Names of quota roots applicable to a particular mailbox can be 259 discovered by issuing the GETQUOTAROOT command, see Section 4.1.2.) 260 Note that the server is not required to support any specific resource 261 type (as advertised in the CAPABILITY response, i.e. all capability 262 items with the "QUOTA=RES-" prefix) for any particular quota root. 264 Example: 266 S: * CAPABILITY [...] QUOTA QUOTA=RES-STORAGE [...] 268 [...] 270 C: G0001 GETQUOTA "!partition/sda4" 272 S: * QUOTA "!partition/sda4" (STORAGE 104 10923847) 274 S: G0001 OK Getquota complete 276 4.1.2. GETQUOTAROOT 278 Arguments: mailbox name 280 Responses: REQUIRED untagged responses: QUOTAROOT, QUOTA 282 Result: OK - getquotaroot completed 284 NO - getquotaroot error: permission denied 286 BAD - command unknown or arguments invalid 288 The GETQUOTAROOT command takes a mailbox name and returns the list of 289 quota roots for the mailbox in an untagged QUOTAROOT response. For 290 each listed quota root, it also returns the quota root's resource 291 usage and limits in an untagged QUOTA response. 293 Note that the mailbox name parameter doesn't have to reference an 294 existing mailbox. This can be handy in order to determine which 295 quotaroot would apply to a mailbox when it gets created. 297 Example: 299 S: * CAPABILITY [...] QUOTA QUOTA=RES-STORAGE QUOTA=RES-MESSAGE 300 [...] 302 [...] 304 C: G0002 GETQUOTAROOT INBOX 306 S: * QUOTAROOT INBOX "#user/alice" "!partition/sda4" 308 S: * QUOTA "#user/alice" (MESSAGE 42 1000) 310 S: * QUOTA "!partition/sda4" (STORAGE 104 10923847) 312 S: G0002 OK Getquotaroot complete 314 4.1.3. SETQUOTA 316 Arguments: quota root 318 list of resource limits 320 Responses: untagged responses: QUOTA 322 Result: OK - setquota completed 323 NO - setquota error: can't set that data 325 BAD - command unknown or arguments invalid 327 Note that unlike other command/responses/response codes defined in 328 this document, support for SETQUOTA command requires the server to 329 advertise "QUOTASET" capability. 331 The SETQUOTA command takes the name of a mailbox quota root and a 332 list of resource limits. The resource limits for the named quota 333 root are changed to be the specified limits. Any previous resource 334 limits for the named quota root are discarded, even resource limits 335 not explicitly listed in the SETQUOTA command. (For example, if the 336 quota root had both STORAGE and MESSAGE limits assigned to the quota 337 root before the SETQUOTA is called and the SETQUOTA only includes the 338 STORAGE limit, then the MESSAGE limit is removed from the quota 339 root.) 341 If the named quota root did not previously exist, an implementation 342 may optionally create it and change the quota roots for any number of 343 existing mailboxes in an implementation-defined manner. 345 If the implementation chooses to change the quota roots for some 346 existing mailboxes such changes SHOULD be announced with untagged 347 QUOTA responses. 349 Example: 351 S: * CAPABILITY [...] QUOTA QUOTASET QUOTA=RES-STORAGE QUOTA=RES- 352 MESSAGE [...] 354 [...] 356 C: S0000 GETQUOTA "#user/alice" 358 S: * QUOTA "#user/alice" (STORAGE 54 111 MESSAGE 42 1000) 360 S: S0000 OK Getquota completed 362 C: S0001 SETQUOTA "#user/alice" (STORAGE 510) 364 S: * QUOTA "#user/alice" (STORAGE 58 512) 366 // The server has rounded the STORAGE quota limit requested to the 367 nearest 512 blocks of 1024 octects, or else another client has 368 performed a near simultaneous SETQUOTA, using a limit of 512. 370 S: S0001 OK Rounded quota 371 C: S0002 SETQUOTA "!partition/sda4" (STORAGE 99999999) 373 S: * QUOTA "!partition/sda4" (STORAGE 104 10923847) 375 // The server has not changed the quota, since this is a 376 filesystem limit, and cannot be changed. The QUOTA response here 377 is entirely optional. 379 S: S0002 NO Cannot change system limit 381 4.1.4. New STATUS attributes 383 DELETED and DELETED-STORAGE status data items allow to estimate the 384 amount of resource freed by an EXPUNGE on a mailbox. 386 The DELETED status data item requests the server to return the number 387 of messages with \Deleted flag set. The DELETED status data item is 388 only required to be implemented when the server advertises QUOTA=RES- 389 MESSAGE capability. 391 The DELETED-STORAGE status data item requests the server to return 392 the amount of storage space that can be reclaimed by performing 393 EXPUNGE on the mailbox. The server SHOULD return the exact value, 394 however it is recognized that the server may have to do non-trivial 395 amount of work to calculate it. If the calculation of the exact 396 value would take a long time, the server MAY instead return the sum 397 of RFC822.SIZEs of messages with the \Deleted flag set. The DELETED- 398 STORAGE status data item is only required to be implemented when the 399 server advertises QUOTA=RES-STORAGE capability. 401 Example: 403 S: * CAPABILITY [...] QUOTA QUOTA=RES-STORAGE QUOTA=RES-MESSAGE 404 [...] 406 [...] 408 C: S0003 STATUS INBOX (MESSAGES DELETED DELETED-STORAGE) 410 S: * STATUS INBOX (MESSAGES 12 DELETED 4 DELETED-STORAGE 8) 412 // 12 messages, 4 of which would be deleted when an EXPUNGE 413 happens. 415 S: S0003 OK Status complete. 417 4.2. Responses 419 The following responses may be sent by the server. 421 4.2.1. QUOTA 423 Data: quota root name 425 list of resource names, usages, and limits 427 This response occurs as a result of a GETQUOTA, a GETQUOTAROOT or a 428 SETQUOTA command. The first string is the name of the quota root for 429 which this quota applies. 431 The name is followed by a S-expression format list of the resource 432 usage and limits of the quota root. The list contains zero or more 433 triplets. Each triplet contains a resource name, the current usage 434 of the resource, and the resource limit. 436 Resources not named in the list are not limited in the quota root. 437 Thus, an empty list means there are no administrative resource limits 438 in the quota root. 440 Example: S: * QUOTA "" (STORAGE 10 512) 442 4.2.2. QUOTAROOT 444 Data: mailbox name 446 zero or more quota root names 448 This response occurs as a result of a GETQUOTAROOT command. The 449 first string is the mailbox and the remaining strings are the names 450 of the quota roots for the mailbox. 452 Examples: 454 S: * QUOTAROOT INBOX "" 456 // The INBOX mailbox is covered by a single quota root with name "". 458 S: * QUOTAROOT comp.mail.mime 460 // The comp.mail.mime mailbox has no quota root associated with it, 461 but one can be created. 463 4.3. Response Codes 464 4.3.1. OVERQUOTA 466 OVERQUOTA response code SHOULD be returned in the tagged NO response 467 to an APPEND/COPY/MOVE when the addition of the message(s) puts the 468 target mailbox over any one of its quota limits. 470 Example 1: C: A003 APPEND saved-messages (\Seen) {326} 471 S: + Ready for literal data 472 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) 473 C: From: Fred Foobar 474 C: Subject: afternoon meeting 475 C: To: mooch@owatagu.siam.edu.example 476 C: Message-Id: 477 C: MIME-Version: 1.0 478 C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII 479 C: 480 C: Hello Joe, do you think we can meet at 3:30 tomorrow? 481 C: 482 S: A003 NO [OVERQUOTA] APPEND Failed 484 The OVERQUOTA response code MAY also be returned in an untagged NO 485 response in the authenticated or the selected state, when a mailbox 486 exceeds soft quota. For example, such OVERQUOTA response code might 487 be sent as a result of an external event (e.g. LMTP delivery or 488 COPY/MOVE/APPEND in another IMAP connection) that causes the 489 currently selected mailbox to exceed soft quota. Note that such 490 OVERQUOTA response code might be ambiguous, because it might relate 491 to the target mailbox (as specified in COPY/MOVE/APPEND) or to the 492 currently selected mailbox. (The WG chose not to address this 493 deficiency due to syntactic limitations of IMAP response codes and 494 because such events are likely to be rare.) This form of the 495 OVERQUOTA response codes MUST NOT be returned if there is no mailbox 496 selected and no command in progress that adds a message to a mailbox 497 (e.g. APPEND). 499 Example 2: C: A003 APPEND saved-messages (\Seen) {326} 500 S: + Ready for literal data 501 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST) 502 C: From: Fred Foobar 503 C: Subject: afternoon meeting 504 C: To: mooch@owatagu.siam.edu.example 505 C: Message-Id: 506 C: MIME-Version: 1.0 507 C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII 508 C: 509 C: Hello Joe, do you think we can meet at 3:30 tomorrow? 510 C: 511 S: * NO [OVERQUOTA] Soft quota has been exceeded 512 S: A003 OK [APPENDUID 38505 3955] APPEND completed 514 Example 3: C: A004 COPY 2:4 MEETING 515 S: * NO [OVERQUOTA] Soft quota has been exceeded 516 S: A004 OK [COPYUID 38505 304,319:320 3956:3958] COPY 517 command completed 519 5. Resource Type Definitions 521 The following resource types are defined in this memo. A server 522 supporting a resource type MUST advertise this as a CAPABILITY with a 523 name consisting of the resource name prefixed by "QUOTA=RES-". A 524 server MAY support multiple resource types, and MUST advertise all 525 resource types it supports. 527 5.1. STORAGE 529 The physical space estimate, in units of 1024 octets, of the 530 mailboxes governed by the quota root. This MAY not be the same as 531 the sum of the RFC822.SIZE of the messages. Some implementations MAY 532 include metadata sizes for the messages and mailboxes, other 533 implementations MAY store messages in such a way that the physical 534 space used is smaller, for example due to use of compression. 535 Additional messages might not increase the usage. Client MUST NOT 536 use the usage figure for anything other than informational purposes, 537 for example, they MUST NOT refuse to APPEND a message if the limit 538 less the usage is smaller than the RFC822.SIZE divided by 1024 of the 539 message, but it MAY warn about such condition. 541 The usage figure may change as a result of performing actions not 542 associated with adding new messages to the mailbox, such as SEARCH, 543 since this may increase the amount of metadata included in the 544 calculations. 546 When the server supports this resource type, it MUST also support the 547 DELETED-STORAGE status data item. 549 Support for this resource MUST be indicated by the server by 550 advertising the CAPABILITY "QUOTA=RES-STORAGE". 552 A resource named the same was also given as an example in RFC2087 553 [RFC2087]. This document provides a more precise definition. 555 5.2. MESSAGE 557 The number of messages stored within the mailboxes governed by the 558 quota root. This MUST be an exact number, however, clients MUST NOT 559 assume that a change in the usage indicates a change in the number of 560 messages available, since the quota root may include mailboxes the 561 client has no access to. 563 When the server supports this resource type, it MUST also support the 564 DELETED status data item. 566 Support for this resource MUST be indicated by the server by 567 advertising the CAPABILITY "QUOTA=RES-MESSAGE". 569 A resource named the same was also given as an example in RFC2087 570 [RFC2087]. This document provides a more precise definition. 572 5.3. MAILBOX 574 The number of mailboxes governed by the quota root. This MUST be an 575 exact number, however, clients MUST NOT assume that a change in the 576 usage indicates a change in the number of mailboxes, since the quota 577 root may include mailboxes the client has no access to. 579 Support for this resource MUST be indicated by the server by 580 advertising the CAPABILITY "QUOTA=RES-MAILBOX". 582 5.4. ANNOTATION-STORAGE 584 The maximum size of all annotations [RFC5257], in units of 1024 585 octets, associated with all messages in the mailboxes governed by the 586 quota root. 588 Support for this resource MUST be indicated by the server by 589 advertising the CAPABILITY "QUOTA=RES-ANNOTATION-STORAGE". 591 6. Interaction with IMAP ACL extension (RFC 4314) 593 This section lists [RFC4314] rights required to execute quota related 594 commands when both RFC 4314 and this document are implemented. 596 +===================+=+=+===+===+===+===+===+===+===+===+=====+=====+ 597 | Operations\Rights |l|r| s | w | i | c | x | t | e | a | Any | Non | 598 +===================+=+=+===+===+===+===+===+===+===+===+=====+=====+ 599 | GETQUOTA | | | | | | | | | | | | + | 600 +-------------------+-+-+---+---+---+---+---+---+---+---+-----+-----+ 601 | GETQUOTAROOT | |*| | | | | | | | | | * | 602 +-------------------+-+-+---+---+---+---+---+---+---+---+-----+-----+ 603 | SETQUOTA | | | | | | | | | | + | | | 604 +-------------------+-+-+---+---+---+---+---+---+---+---+-----+-----+ 606 Table 1 608 See Section 4 of RFC 4314 for conventions used in this table. 610 Legend: 612 + - The right is required 614 * - Only one of the rights marked with * is required 616 "Any" - at least one of the "l", "r", "i", "k", "x", "a" rights is 617 required 619 "Non" - no rights required to perform the command 621 Note that which permissions are needed in order to perform 622 GETQUOTAROOT command depends on the quota resource type being 623 requested. For example, a quota on number of messages (MESSAGE 624 resource type) or total size of messages (STORAGE resource type) 625 requires "r" right on the mailbox in question, since the quota 626 involved would reveal information about the number (or total size) of 627 messages in the mailbox. By comparison, the MAILBOX resource type 628 doesn't require any right. 630 7. Formal syntax 632 The following syntax specification uses the Augmented Backus-Naur 633 Form (ABNF) notation as specified in [ABNF]. 635 Non-terminals referenced but not defined below are as defined by 636 IMAP4 [RFC3501]. 638 Except as noted otherwise, all alphabetic characters are case- 639 insensitive. The use of upper or lower case characters to define 640 token strings is for editorial clarity only. Implementations MUST 641 accept these strings in a case-insensitive fashion. 643 getquota = "GETQUOTA" SP quota-root-name 645 getquotaroot = "GETQUOTAROOT" SP mailbox 647 quota-list = "(" quota-resource *(SP quota-resource) ")" 649 quota-resource = resource-name SP resource-usage SP resource-limit 651 quota-response = "QUOTA" SP quota-root-name SP quota-list 653 quotaroot-response = "QUOTAROOT" SP mailbox *(SP quota-root-name) 655 setquota = "SETQUOTA" SP quota-root-name SP setquota-list 657 setquota-list = "(" [setquota-resource *(SP setquota-resource)] 658 ")" 660 setquota-resource = resource-name SP resource-limit 662 quota-root-name = astring 664 resource-limit = number64 666 resource-name = "STORAGE" / "MESSAGE" / "MAILBOX" / 668 "ANNOTATION-STORAGE" / resource-name-ext 670 resource-name-ext = atom 672 ;; Future resource registrations 674 resource-usage = number64 676 ;; must be less than corresponding resource-limit 678 capability-quota = capa-quota-res / "QUOTASET" 680 ;; One or more capa-quota-res must be returned. 682 ;; Also "QUOTASET" can optionally be returned. 684 capa-quota-res = "QUOTA=RES-" resource-name 685 status-att =/ "DELETED" / "DELETED-STORAGE" 687 ;; DELETED status data item MUST be supported 689 ;; when "QUOTA=RES-MESSAGE" capability is 691 ;; advertised. 693 ;; DELETED-STORAGE status data item MUST be 695 ;; supported when "QUOTA=RES-STORAGE" capability 697 ;; is advertised. 699 status-att-val =/ status-att-deleted / 701 status-att-deleted-storage 703 status-att-deleted = "DELETED" SP number 705 ;; DELETED status data item MUST be supported 707 ;; when "QUOTA=RES-MESSAGE" capability is 709 ;; advertised. 711 status-att-deleted-storage = "DELETED-STORAGE" SP number64 713 ;; DELETED-STORAGE status data item MUST be 715 ;; supported when "QUOTA=RES-STORAGE" capability 717 ;; is advertised. 719 resp-text-code =/ "OVERQUOTA" 721 number64 = 723 8. Security Considerations 725 Implementors should be careful to make sure the implementation of 726 these commands does not violate the site's security policy. The 727 resource usage of other users is likely to be considered confidential 728 information and should not be divulged to unauthorized persons. In 729 particular, no quota information should be disclosed to anonymous 730 users. 732 As for any resource shared across users (for example a quota root 733 attached to a set of shared mailboxes), a user that can consume or 734 render unusable the resource can affect the resources available to 735 the other users; this might occur, for example, by a user with 736 permission to execute SETQUOTA setting an artificially small value. 738 Note that computing resource usage might incur a heavy load on the 739 server. Server implementers should consider implementation 740 techniques that lower load on servers, such as caching of resource 741 usage information or usage of less precise computations when under 742 heavy load. 744 9. IANA Considerations 746 9.1. Changes/additions to the IMAP4 capabilities registry 748 IMAP4 capabilities are registered by publishing a standards track or 749 IESG approved Informational or Experimental RFC. The registry is 750 currently located at: 752 https://www.iana.org/assignments/imap4-capabilities 754 IANA is requested to update definition of the QUOTA extension to 755 point to this document. IANA is also requested to add the "QUOTASET" 756 capability to the IMAP4 capabilities registry, with this document as 757 the reference. 759 IANA is requested to reserve the prefix "QUOTA=RES-" in the IMAP4 760 capabilities registry and add a pointer to this document and to the 761 IMAP quota resource type registry (see Section 9.2). 763 IANA is requested to reserve all other capabilities starting with 764 "QUOTA=" prefix for future IETF Stream extensions to this document. 766 9.2. IMAP quota resource type registry 768 IANA is requested to create a new registry for IMAP quota resource 769 types. Registration policy for this registry is "Specification 770 Required". When registering a new quota resource type, the 771 registrant need to provide the following: Name of the quota resource 772 type, Author/Change Controller name and email address, short 773 description, extra (if any) required and optional IMAP commands/ 774 responses, and a reference to a specification that describes the 775 quota resource type in more details. 777 Designated Experts should check that provided references are correct, 778 that they describe the quota resource type being registered in 779 sufficient details to be implementable, that syntax of any optional 780 commands/responses is correct (e.g. ABNF validates), and their 781 syntax/description complies with rules and limitations imposed by 782 IMAP [RFC3501][RFC9051]. Designated Experts should avoid registering 783 multiple identical quota resource types under different names and 784 should provide advice to requestors about other possible quota 785 resource types to use. 787 This document includes initial registrations for the following IMAP 788 quota resource type: STORAGE (Section 5.1), MESSAGE (Section 5.2), 789 MAILBOX (Section 5.3) and "ANNOTATION-STORAGE" (Section 5.4). See 790 Section 9.3 for the registration templates. 792 9.3. Registrations of IMAP Quota Resource Types 794 Name of the quota resource type: STORAGE 796 Author: Alexey Melnikov 798 Change Controller: IESG 800 Description: The physical space estimate, in units of 1024 octets, 801 of the mailboxes governed by the quota root. 803 Extra required IMAP commands/responses: DELETED-STORAGE STATUS 804 request data item and response data item 806 Extra optional IMAP commands/responses: N/A 808 Reference: Section 5.1 of RFCXXXX 810 Name of the quota resource type: MESSAGE 812 Author: Alexey Melnikov 814 Change Controller: IESG 816 Description: The number of messages stored within the mailboxes 817 governed by the quota root. 819 Extra required IMAP commands/responses: DELETED STATUS request data 820 item and response data item 822 Extra optional IMAP commands/responses: N/A 824 Reference: Section 5.2 of RFCXXXX 826 Name of the quota resource type: MAILBOX 827 Author: Alexey Melnikov 829 Change Controller: IESG 831 Description: The number of mailboxes governed by the quota root. 833 Extra required IMAP commands/responses: N/A 835 Extra optional IMAP commands/responses: N/A 837 Reference: Section 5.3 of RFCXXXX 839 Name of the quota resource type: ANNOTATION-STORAGE 841 Author: Alexey Melnikov 843 Change Controller: IESG 845 Description: The maximum size of all annotations [RFC5257], in units 846 of 1024 octets, associated with all messages in the mailboxes 847 governed by the quota root. 849 Extra required IMAP commands/responses: N/A 851 Extra optional IMAP commands/responses: N/A 853 Reference: Section 5.4 of RFCXXXX 855 10. Contributors 857 Dave Cridland wrote lots of text in an earlier draft that became the 858 basis for this document. 860 11. Acknowledgments 862 Editor of this document would like to thank the following people who 863 provided useful comments or participated in discussions that lead to 864 this update to RFC 2087: John Myers, Cyrus Daboo, Lyndon Nerenberg, 865 Benjamin Kaduk, Roman Danyliw, Eric Vyncke. 867 This document is a revision of RFC 2087. It borrows a lot of text 868 from RFC 2087. Thus work of the RFC 2087 author John Myers is 869 appreciated. 871 12. Changes since RFC 2087 873 This document is a revision of RFC 2087. It tries to clarify the 874 meaning of different terms used by RFC 2087. It also provides more 875 examples, gives guidance on allowed server behaviour, defines IANA 876 registry for quota resource types and provides initial registrations 877 for 4 of them. 879 When compared with RFC 2087, this document defines two more commonly 880 used resource type, adds optional OVERQUOTA response code and defines 881 two extra STATUS data items ("DELETED" and "DELETED-STORAGE"). The 882 DELETED STATUS data item must be implemented if the QUOTA=RES-MESSAGE 883 capability is advertised. The DELETED-STORAGE STATUS data item must 884 be implemented if the QUOTA=RES-STORAGE capability is advertised. 885 For extensibility quota usage and quota limits are now 63 bit 886 unsigned integers. 888 13. References 890 13.1. Normative References 892 [ABNF] Crocker, D., Ed. and P. Overell, Ed., "Augmented BNF for 893 Syntax Specifications: ABNF", RFC 5234, January 2008, 894 . 896 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 897 Requirement Levels", BCP 14, RFC 2119, 898 DOI 10.17487/RFC2119, March 1997, 899 . 901 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 902 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 903 . 905 [RFC4314] Melnikov, A., "IMAP4 Access Control List (ACL) Extension", 906 RFC 4314, DOI 10.17487/RFC4314, December 2005, 907 . 909 [RFC5257] Daboo, C. and R. Gellens, "Internet Message Access 910 Protocol - ANNOTATE Extension", RFC 5257, 911 DOI 10.17487/RFC5257, June 2008, 912 . 914 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 915 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 916 May 2017, . 918 [RFC9051] Melnikov, A., Ed. and B. Leiba, Ed., "Internet Message 919 Access Protocol (IMAP) - Version 4rev2", RFC 9051, 920 DOI 10.17487/RFC9051, August 2021, 921 . 923 13.2. Informative References 925 [RFC2087] Myers, J., "IMAP4 QUOTA extension", RFC 2087, 926 DOI 10.17487/RFC2087, January 1997, 927 . 929 Author's Address 931 Alexey Melnikov 932 Isode Limited 934 Email: alexey.melnikov@isode.com 935 URI: https://www.isode.com