idnits 2.17.1 draft-ietf-imapext-2086upd-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 967. -- Found old boilerplate from RFC 3978, Section 5.5 on line 1007. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 978. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 985. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 991. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** An RFC 3978, Section 5.1 paragraph was found, but not on the first page, as required. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 1181 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 164 instances of too long lines in the document, the longest one being 13 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 2005) is 6951 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) == Missing Reference: 'StringPrep' is mentioned on line 303, but not defined == Missing Reference: 'UNSEEN 12' is mentioned on line 723, but not defined == Missing Reference: 'UIDVALIDITY 3857529045' is mentioned on line 724, but not defined == Missing Reference: 'UIDNEXT 4392' is mentioned on line 725, but not defined == Missing Reference: 'IMAP' is mentioned on line 854, but not defined == Unused Reference: 'Stringprep' is defined on line 944, but no explicit reference was found in the text == Unused Reference: 'RFC2086' is defined on line 952, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2234 (ref. 'ABNF') (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 3501 (ref. 'IMAP4') (Obsoleted by RFC 9051) ** Obsolete normative reference: RFC 3454 (ref. 'Stringprep') (Obsoleted by RFC 7564) ** Obsolete normative reference: RFC 4013 (ref. 'SASLprep') (Obsoleted by RFC 7613) -- Obsolete informational reference (is this intentional?): RFC 2086 (Obsoleted by RFC 4314) Summary: 10 errors (**), 0 flaws (~~), 10 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group A. Melnikov 2 Internet Draft Editor 3 Document: draft-ietf-imapext-2086upd-06.txt April 2005 4 Obsoletes: 2086 5 Expires: October 2005 7 IMAP4 ACL extension 9 Status of this Memo 11 By submitting this Internet-Draft, each author represents that any 12 applicable patent or other IPR claims of which he or she is aware 13 have been or will be disclosed, and any of which he or she becomes 14 aware will be disclosed, in accordance with Section 6 of BCP 79. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet-Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six 21 months and may be updated, replaced, or obsoleted by other documents 22 at any time. It is inappropriate to use Internet-Drafts as reference 23 material or to cite them other than as "work in progress". 25 The list of current Internet-Drafts can be accessed at 26 http://www.ietf.org/ietf/1id-abstracts.txt 28 The list of Internet-Draft Shadow Directories can be accessed at 29 http://www.ietf.org/shadow.html. 31 Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or 32 munnari.oz.au. 34 A revised version of this draft document will be submitted to the RFC 35 editor as a Proposed Standard for the Internet Community. Discussion 36 and suggestions for improvement are requested. Distribution of this 37 draft is unlimited. 39 Abstract 41 The ACL (Access Control List) extension (RFC 2086) of the Internet 42 Message Access Protocol (IMAP) permits mailbox access control 43 lists to be retrieved and manipulated through the IMAP protocol. 45 This document is a revision of RFC 2086. It defines several new 46 access control rights and clarifies which rights are required for 47 different IMAP commands. 49 1. Conventions Used in this Document 51 In examples, "C:" and "S:" indicate lines sent by the client and 52 server respectively. 54 In all examples "/" character is used as hierarchy separator. 56 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 57 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 58 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 60 The phrase "ACL server" is just a short cut for saying "IMAP server 61 that supports ACL extension as defined in this document". 63 2. Introduction and Overview 65 The ACL (Access Control List) extension of the Internet Message 66 Access Protocol [IMAP4] permits mailbox access control lists to be 67 retrieved and manipulated through the IMAP protocol. 69 This document is a revision of RFC 2086. It tries to clarify 70 different ambiguities in RFC 2086, in particular use of UTF-8 71 [UTF-8] in identifiers, which rights are required for different IMAP4 72 commands; how READ-WRITE/READ-ONLY response codes are related to ACL. 74 3. Access Control 76 The ACL extension is present in any IMAP4 implementation which 77 returns "ACL" as one of the supported capabilities to the CAPABILITY 78 command. 80 A server implementation conformant to this document MUST also return 81 rights (see below) not defined in section 3.2 in the "RIGHTS=" 82 capability. 84 An access control list is a set of pairs. 85 An ACL applies to a mailbox name. 87 Identifier is a UTF-8 [UTF-8] string. The identifier "anyone" is 88 reserved to refer to the universal identity (all authentications, 89 including anonymous). All user name strings accepted by the LOGIN or 90 AUTHENTICATE commands to authenticate to the IMAP server are reserved 91 as identifiers for the corresponding users. Identifiers starting 92 with a dash ("-") are reserved for "negative rights", described 93 below. All other identifier strings are interpreted in an 94 implementation-defined manner. 96 Rights is a string listing a (possibly empty) set of alphanumeric 97 characters, each character listing a set of operations which is being 98 controlled. Lowercase letters are reserved for "standard" rights, 99 listed in section 3.1. (Note that for compatibility with deployed 100 clients and servers uppercase rights are not allowed). The set of 101 standard rights can only be extended by a standards-track document. 102 Digits are reserved for implementation or site defined rights. 104 An implementation MAY tie rights together or MAY force rights to 105 always or never be granted to particular identifiers. For example, 106 in an implementation that uses UNIX mode bits, the rights "swite" are 107 tied, the "a" right is always granted to the owner of a mailbox and 108 is never granted to another user. If rights are tied in an 109 implementation, the implementation must be conservative in granting 110 rights in response to SETACL commands--unless all rights in a tied 111 set are specified, none of that set should be included in the ACL 112 entry for that identifier. A client can discover the set of rights 113 which may be granted to a given identifier in the ACL for a given 114 mailbox name by using the LISTRIGHTS command. 116 It is possible for multiple identifiers in an access control list to 117 apply to a given user. For 118 example, an ACL may include rights to be granted to the identifier 119 matching the user, one or more implementation-defined identifiers 120 matching groups which include the user, and/or the identifier 121 "anyone". How these rights are combined to determine the user's 122 access is implementation-defined. An implementation may choose, for 123 example, to use the union of the rights granted to the applicable 124 identifiers. An implementation may instead choose, for example, to 125 only use those rights granted to the most specific identifier present 126 in the ACL. A client can determine the set of rights granted to the 127 logged-in user for a given mailbox name by using the MYRIGHTS 128 command. 130 When an identifier in an ACL starts with a dash ("-"), that indicates 131 that associated rights are to be removed from the identifier that is 132 prefixed by the dash. This is referred to as a "negative right". 133 This differs from DELETEACL in that a negative right is added to the 134 ACL, and is a part of the calculation of the rights. 136 Let's assume that an identifier "fred" refers to a user with login 137 "fred". If the identifier "-fred" is granted the "w" right, 138 that indicates that the "w" right is to be removed from users 139 matching the identifier "fred", even though the user "fred" might 140 have the "w" right as a consequence of some other identifier in 141 the ACL. A DELETEACL of "fred" simply deletes the identifier "fred" 142 from the ACL; it does not affect any rights that the user "fred" 143 may get from another entry in the ACL, in particular it doesn't 144 affect rights granted to the identifier "-fred". 146 Server implementations are not required to support "negative right" 147 identifiers. 149 3.1. Standard rights 151 The currently defined standard rights are (note that the list below 152 doesn't list all commands that use a particular right): 154 l - lookup (mailbox is visible to LIST/LSUB commands, SUBSCRIBE mailbox) 155 r - read (SELECT the mailbox, perform STATUS) 156 s - keep seen/unseen information across sessions (set or clear \SEEN flag 157 via STORE, also set \SEEN during APPEND/COPY/FETCH BODY[...]) 158 w - write (set or clear flags other than \SEEN and \DELETED via STORE, 159 also set them during APPEND/COPY) 160 i - insert (perform APPEND, COPY into mailbox) 161 p - post (send mail to submission address for mailbox, 162 not enforced by IMAP4 itself) 163 k - create mailboxes (CREATE new sub-mailboxes in any 164 implementation-defined hierarchy, parent mailbox for the new 165 mailbox name in RENAME) 166 x - delete mailbox (DELETE mailbox, old mailbox name in RENAME) 167 t - delete messages (set or clear \DELETED flag via STORE, set \DELETED flag 168 during APPEND/COPY) 169 e - perform EXPUNGE and expunge as a part of CLOSE. 170 a - administer (perform SETACL/DELETEACL/GETACL) 172 3.1.1. Obsolete rights 174 Due to ambiguity in RFC 2086 some existing RFC 2086 server implementations 175 use the "c" right to control the DELETE command. Others chose to use the 176 "d" right to control the DELETE command. 177 For the former group, let's define the "create" right as union of the "k" 178 and "x" rights, and the "delete" right as union of the "e" and "t" rights. 179 For the latter group, let's define the "create" rights as a synonym to the 180 "k" right, and the "delete" right as union of the "e", "t" and "x" rights. 182 For compatibility with RFC 2086 this section defines two virtual rights 183 "d" and "c". 185 If a client includes the "d" right in a rights list, then it MUST be 186 treated as if the client had included every member of the "delete" right. 187 (It is not an error for a client to specify both the "d" right and 188 one or more members of the "delete" right, but the effect is no different 189 than if just the "d" right or all members of the "delete" right had been 190 specified). 192 When any of the "delete" member rights is set in a list of 193 rights, the server MUST also include the "d" right when returning 194 the list in a MYRIGHTS or ACL response. This is so to enable older clients 195 conforming to RFC 2086 to work with newer servers. (*) 197 Example: C: A001 SETACL INBOX/Drafts David lrswida 198 S: A001 OK Setacl complete 200 The client has specified the "d" right in the SETACL command above and it 201 expands to "et" on the server: 203 C: A002 GETACL INBOX/Drafts 204 S: * ACL INBOX Fred rwipslxetda David lrswideta 205 S: A002 OK Getacl complete 207 If the identifier specified in the LISTRIGHTS command can be 208 granted any of the "delete" member rights on a mailbox, then the server 209 MUST include the "d" right in the corresponding LISTRIGHTS response. (*) 210 If the member rights aren't tied to non-member rights, then the "d" right 211 is returned by itself in the LISTRIGHTS response. If any of the member rights 212 needs to be tied to one (or more) non-member right, then the "d" right and all 213 of the member rights need to be tied to the same non-member right(s) (**). 215 If a client includes the "c" right in a rights list, then it MUST be 216 treated as if the client had included every member of the "create" right. 217 (It is not an error for a client to specify both the "c" right and 218 one or more members of the "create" right, but the effect is no different 219 than if just the "c" right or all members of the "create" right had been 220 specified). 222 When any of the "create" member rights is set in a list of 223 rights, the server MUST also include the "c" right when returning 224 the list in a MYRIGHTS or ACL response. This is so to enable older clients 225 conforming to RFC 2086 to work with newer servers. (*) 227 Example: C: A003 SETACL INBOX/Drafts Byron lrswikda 228 S: A001 OK Setacl complete 229 C: A002 GETACL INBOX/Drafts 230 S: * ACL INBOX Fred rwipslxeta Byron lrswikcdeta 231 S: A002 OK Getacl complete 233 The client has specified the "d" right in the SETACL command above and it 234 expands to "et" on the server: As the client has specified the "k" right 235 (which is a member of the "c" right), the server also returns the "c" right. 237 If the identifier specified in the LISTRIGHTS command can be 238 granted any of the "create" member rights on a mailbox, then the server 239 MUST include the "c" right in the corresponding LISTRIGHTS response. (*) 240 If the member rights aren't tied to non-member rights, then the "c" right 241 is returned by itself in the LISTRIGHTS response. If any of the member rights 242 needs to be tied to one (or more) non-member right, then the "c" right and all 243 of the member rights need to be tied to the same non-member right(s) (**). 245 Example: The server that ties the rights as follows 247 lr s w i p k x t 249 and c=k 251 will return: 253 S: * LISTRIGHTS archive/imap anyone "" lr s w i p k x t c d 255 Example: The server that ties the rights as follows 257 lr s w i p k xte 259 and c=k 261 will return: 263 S: * LISTRIGHTS archive/imap anyone "" lr s w i p k xte c d 265 Example: The server that ties the rights as follows 267 lr s w i p k x te 269 and c=k 271 will return: 273 S: * LISTRIGHTS archive/imap anyone "" lr s w i p k c x te d 275 Example: The server that ties the rights as follows 277 lr swte i p k x 279 and c=kx 281 will return: 283 S: * LISTRIGHTS archive/imap anyone "" lr swted i p k x c 285 (*) Clients conforming to this document MUST ignore the virtual "d" and "c" 286 rights in MYRIGHTS, ACL and LISTRIGHTS responses. 288 (**) The IMAPEXT Working Group has debated this issue in great length 289 and after reviewing existing ACL implementations concluded that this is 290 a reasonable restriction. 292 3.2. Rights defined in RFC 2086. 294 The "RIGHTS=" capability MUST NOT include any of the rights defined 295 in RFC 2086: "l", "r", "s", "w", "i", "p", "a", "c", "d", and the digits 296 ("0" .. "9"). 298 4. Access control management commands and responses 300 Servers, when processing a command that has an identifier 301 as a parameter (i.e. any of SETACL, DELETEACL and LISTRIGHTS commands), 302 SHOULD first prepare the received identifier using "SASLprep" profile 303 [SASLprep] of the "stringprep" algorithm [StringPrep]. If the 304 preparation of the identifier fails or results in an empty string, the 305 server MUST refuse to perform the command with a BAD response. 307 4.1. SETACL command 309 Arguments: mailbox name 310 identifier 311 access right modification 313 Data: no specific data for this command 315 Result: OK - setacl completed 316 NO - setacl failure: can't set acl 317 BAD - arguments invalid 319 The SETACL command changes the access control list on the 320 specified mailbox so that the specified identifier is granted 321 permissions as specified in the third argument. 323 The third argument is a string containing an optional plus ("+") 324 or minus ("-") prefix, followed by zero or more rights characters. 325 If the string starts with a plus, the following rights are added 326 to any existing rights for the identifier. If the string starts 327 with a minus, the following rights are removed from any existing 328 rights for the identifier. If the string does not start with a 329 plus or minus, the rights replace any existing rights for the 330 identifier. 332 Note that an unrecognized right MUST cause the command to return 333 the BAD response. In particular, server MUST NOT silently ignore 334 unrecognized rights. 336 Example: C: A001 GETACL INBOX/Drafts 337 S: * ACL INBOX/Drafts Fred rwipslxetad Chris lrswi 338 S: A001 OK Getacl complete 339 C: A002 SETACL INBOX/Drafts Chris +cda 340 S: A002 OK Setacl complete 341 C: A003 GETACL INBOX/Drafts 342 S: * ACL INBOX/Drafts Fred rwipslxetad Chris lrswicdakxet 343 S: A003 OK Getacl complete 345 C: A035 SETACL INBOX/Drafts John lrQswicda 346 S: A035 BAD Uppercase rights are not allowed 348 C: A036 SETACL INBOX/Drafts John lrqswicda 349 S: A036 BAD The q right is not supported 351 4.2. DELETEACL command 353 Arguments: mailbox name 354 identifier 356 Data: no specific data for this command 358 Result: OK - deleteacl completed 359 NO - deleteacl failure: can't delete acl 360 BAD - arguments invalid 362 The DELETEACL command removes any pair for the 363 specified identifier from the access control list for the specified 364 mailbox. 366 Example: C: B001 GETACL INBOX 367 S: * ACL INBOX Fred rwipslxetad -Fred wetd $team w 368 S: B001 OK Getacl complete 369 C: B002 DELETEACL INBOX Fred 370 S: B002 OK Deleteacl complete 371 C: B003 GETACL INBOX 372 S: * ACL INBOX -Fred wetd $team w 373 S: B003 OK Getacl complete 375 4.3. GETACL command 377 Arguments: mailbox name 379 Data: untagged responses: ACL 381 Result: OK - getacl completed 382 NO - getacl failure: can't get acl 383 BAD - arguments invalid 385 The GETACL command returns the access control list for mailbox in 386 an untagged ACL response. 388 Some implementations MAY permit multiple forms of an 389 identifier to reference the same IMAP account. Usually, such 390 implementations will have a canonical form that is stored internally. 391 An ACL response caused by an GETACL command MAY include a 392 canonicalized form of the identifier which might be 393 different from the one used in the corresponding SETACL command. 395 Example: C: A002 GETACL INBOX 396 S: * ACL INBOX Fred rwipsldexta 397 S: A002 OK Getacl complete 399 4.4. LISTRIGHTS command 401 Arguments: mailbox name 402 identifier 404 Data: untagged responses: LISTRIGHTS 406 Result: OK - listrights completed 407 NO - listrights failure: can't get rights list 408 BAD - arguments invalid 410 The LISTRIGHTS command takes a mailbox name and an identifier and 411 returns information about what rights can be granted to the identifier 412 in the ACL for the mailbox. 414 Some implementations MAY permit multiple forms of an 415 identifier to reference the same IMAP account. Usually, such 416 implementations will have a canonical form that is stored internally. 417 A LISTRIGHTS response caused by a LISTRIGHTS command MUST always 418 return the same form of an identifier as specified 419 by the client. This is to allow the client to correlate the response 420 with the command. 422 Example: C: a001 LISTRIGHTS ~/Mail/saved smith 423 S: * LISTRIGHTS ~/Mail/saved smith la r swicdkxte 424 S: a001 OK Listrights completed 426 Example: C: a005 LISTRIGHTS archive/imap anyone 427 S: * LISTRIGHTS archive.imap anyone "" l r s w i p k x t 428 e c d a 0 1 2 3 4 5 6 7 8 9 429 S: a005 Listrights successful 431 4.5. MYRIGHTS command 433 Arguments: mailbox name 435 Data: untagged responses: MYRIGHTS 437 Result: OK - myrights completed 438 NO - myrights failure: can't get rights 439 BAD - arguments invalid 441 The MYRIGHTS command returns the set of rights that the user has 442 to mailbox in an untagged MYRIGHTS reply. 444 Example: C: A003 MYRIGHTS INBOX 445 S: * MYRIGHTS INBOX rwiptsldaex 446 S: A003 OK Myrights complete 448 4.6. ACL response 450 Data: mailbox name 451 zero or more identifier rights pairs 453 The ACL response occurs as a result of a GETACL command. The first 454 string is the mailbox name for which this ACL applies. This is 455 followed by zero or more pairs of strings, each pair contains the 456 identifier for which the entry applies followed by the set of 457 rights that the identifier has. 459 Section 3.1.1 details additional server requirements related to handling 460 of the virtual "d" and "c" rights. 462 4.7. LISTRIGHTS response 464 Data: mailbox name 465 identifier 466 required rights 467 list of optional rights 469 The LISTRIGHTS response occurs as a result of a LISTRIGHTS 470 command. The first two strings are the mailbox name and identifier 471 for which this rights list applies. Following the identifier is a 472 string containing the (possibly empty) set of rights the 473 identifier will always be granted in the mailbox. 475 Following this are zero or more strings each containing a set of 476 rights the identifier can be granted in the mailbox. Rights 477 mentioned in the same string are tied together. The server MUST 478 either grant all tied rights to the identifier in the mailbox or 479 grant none. Section 3.1.1 details additional server requirements 480 related to handling of the virtual "d" and "c" rights. 482 The same right MUST NOT be listed more than once in the LISTRIGHTS 483 command. 485 4.8. MYRIGHTS response 487 Data: mailbox name 488 rights 490 The MYRIGHTS response occurs as a result of a MYRIGHTS command. 491 The first string is the mailbox name for which these rights apply. 492 The second string is the set of rights that the client has. 494 Section 3.1.1 details additional server requirements related to handling 495 of the virtual "d" and "c" rights. 497 5. Rights required to perform different IMAP4rev1 commands 499 Before executing a command an ACL compliant server MUST check which rights 500 are required to perform it. This section groups command by functions 501 they perform and list the rights required. It also gives the detailed 502 description of any special processing required. 504 For the purpose of this section the UID counterpart of a command is 505 considered to be the same command, e.g. both UID COPY and COPY commands 506 require the same set of rights. 508 The table below summarizes different rights or their combinations that are 509 required in order to perform different IMAP operations. As it is not always 510 possible to express complex right checking and interactions, the description 511 after the table should be used as the primary reference. 513 +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ 514 | Operations\Rights | l | r | s | w | i | k | x | t | e | a | Any | None | 515 +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ 516 | commands in authenticated state | 517 +--------------------------------------------------------------------------+ 518 | LIST | + | | | | | | | | | | | | 519 | SUBSCRIBE | * | | | | | | | | | | | * | 520 | UNSUBSCRIBE | | | | | | | | | | | | + | 521 | LSUB | * | | | | | | | | | | | * | 522 | CREATE (for parent) | | | | | | + | | | | | | | 523 | DELETE | | | | | | | + | ? | ? | | | | 524 | RENAME | | | | | | + | + | | | | | | 525 |SELECT/EXAMINE/STATUS| | + | | | | | | | | | | | 526 | SETACL/DELETEACL | | | | | | | | | | + | | | 527 | GETACL/LISTRIGHTS | | | | | | | | | | + | | | 528 | MYRIGHTS | | | | | | | | | | | + | | 529 | APPEND | | | ? | ? | + | | | ? | | | | | 530 +--------------------------------------------------------------------------+ 531 | commands in selected state | 532 +--------------------------------------------------------------------------+ 533 | APPEND | | | ? | ? | + | | | ? | | | | | 534 | EXPUNGE/CLOSE | | | | | | | | | + | | | | 535 | FETCH | | | ? | | | | | | | | | | 536 | STORE flags | | | ? | ? | | | | ? | | | | | 537 +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ 538 Note: for all commands in the selected state the "r" is implied, because 539 it is required to SELECT/EXAMINE a mailbox. Servers are not required 540 to check presence of the "r" right once a mailbox is successfully 541 selected. 543 Legend: 544 + - The right is required 545 * - Only one of the rights marked with * is required (see description below) 546 ? - The right is OPTIONAL (see description below) 547 "Any" - at least one of the "l", "r", "i", "k", "x", "a" rights is 548 required 549 "None" - No rights required to perform the command 551 Listing and subscribing/unsubscribing mailboxes: 552 LIST - "l" right is required. However, unlike other commands (e.g. SELECT) 553 the server MUST NOT return a NO response if it can't list a mailbox. 555 Note that if the user has "l" right to a mailbox "A/B", but not to its parent 556 mailbox "A", the LIST command should behave as if the mailbox "A" doesn't exist, 557 for example: 558 C: A777 LIST "" * 559 S: * LIST (\NoInferiors) "/" "A/B" 560 S: * LIST () "/" "C" 561 S: * LIST (\NoInferiors) "/" "C/D" 562 S: A777 OK LIST completed 564 SUBSCRIBE - "l" right is required only if the server checks for mailbox existence 565 when performing SUBSCRIBE. 567 UNSUBSCRIBE - no rights required to perform this operation. 569 LSUB - "l" right is required only if the server checks for mailbox existence when 570 performing SUBSCRIBE. However, unlike other commands (e.g. SELECT) 571 the server MUST NOT return a NO response if it can't list a subscribed 572 mailbox. 574 Mailbox management: 575 CREATE - "k" right on a nearest existing parent mailbox. When a new 576 mailbox is created it SHOULD inherit the ACL from the parent 577 mailbox (if one exists) in the defined hierarchy. 579 DELETE - "x" right on the mailbox. Note that some servers don't allow 580 to delete a non-empty mailbox. If this is the case, the user 581 would also need "r", "e" and "t" rights, in order to open the 582 mailbox and empty it. 584 The DELETE command MUST delete the ACL associated with the 585 deleted mailbox. 587 RENAME - Moving a mailbox from one parent to another requires the "x" right 588 on the mailbox itself and the "k" right for the new parent. 589 For example, if the user wants to rename mailbox named "A/B/C" to 590 "D/E", the user must have the "x" right for the mailbox "A/B/C" 591 and the "k" right for the mailbox "D". 593 The RENAME command SHOULD NOT change the ACLs on the renamed 594 mailbox and submailboxes. 596 Copying or appending messages: 598 Before performing a COPY/APPEND command the server MUST check if the 599 user has "i" right for the target mailbox. If the user doesn't have "i" 600 right, the operation fails. Otherwise for each copied/appended message 601 the server MUST check if the user has 602 "t" right - when the message has \Deleted flag set 603 "s" right - when the message has \Seen flag set 604 "w" right for all other message flags. 605 Only when the user has a particular right the corresponding flags are 606 stored for the newly created message. The server MUST NOT fail 607 a COPY/APPEND if the user has no rights to set a particular flag. 609 Example: C: A003 MYRIGHTS TargetMailbox 610 S: * MYRIGHTS TargetMailbox rwis 611 S: A003 OK Myrights complete 613 C: A004 FETCH 1:3 (FLAGS) 614 S: * 1 FETCH (FLAGS (\Draft \Deleted) 615 S: * 2 FETCH (FLAGS (\Answered) 616 S: * 3 FETCH (FLAGS ($Forwarded \Seen) 617 S: A004 OK Fetch Completed 619 C: A005 COPY 1:3 TargetMailbox 620 S: A005 OK Copy completed 622 C: A006 SELECT TargetMailbox 623 ... 624 S: A006 Select Completed 626 Let's assume that the copied messages received message numbers 77:79. 628 C: A007 FETCH 77:79 (FLAGS) 629 S: * 77 FETCH (FLAGS (\Draft)) 630 S: * 78 FETCH (FLAGS (\Answered)) 631 S: * 79 FETCH (FLAGS ($Forwarded \Seen)) 632 S: A007 OK Fetch Completed 634 \Deleted flag was lost on COPY, as the user has no "t" right in the 635 target mailbox. 637 If the MYRIGHTS command with the tag A003 would have returned: 638 S: * MYRIGHTS TargetMailbox rsti 640 the response from the FETCH with the tag A007 would have been: 642 C: A007 FETCH 77:79 (FLAGS) 643 S: * 77 FETCH (FLAGS (\Deleted)) 644 S: * 78 FETCH (FLAGS ()) 645 S: * 79 FETCH (FLAGS (\Seen)) 646 S: A007 OK Fetch Completed 648 In the latter case \Answered, $Forwarded and \Draft flags were lost 649 on COPY, as the user has no "w" right in the target mailbox. 651 Expunging the selected mailbox: 652 EXPUNGE - "e" right on the selected mailbox. 654 CLOSE - "e" right on the selected mailbox. If the server is unable to 655 expunge the mailbox because the user doesn't have the "e" right, 656 the server MUST ignore expunge request, close the mailbox 657 and return tagged OK response. 659 Fetch information about a mailbox and its messages: 660 SELECT/EXAMINE/STATUS - "r" right on the mailbox. 662 FETCH - A FETCH request that implies setting \Seen flag MUST NOT set it, 663 if the current user doesn't have "s" right. 665 Changing flags: 666 STORE - the server MUST check if the user has 667 "t" right - when the user modifies \Deleted flag 668 "s" right - when the user modifies \Seen flag 669 "w" right for all other message flags. 670 STORE operation SHOULD NOT fail if the user has rights to modify at least 671 one flag specified in the STORE, as the tagged NO response to a STORE 672 command is not handled very well by deployed clients. 674 Changing ACLs: 675 SETACL/DELETEACL - "a" right on the mailbox. 677 Reading ACLs: 678 GETACL - "a" right on the mailbox. 680 MYRIGHTS - any of the following rights is required to perform 681 the operation: "l", "r", "i", "k", "x", "a". 683 LISTRIGHTS - "a" right on the mailbox. 685 6. Other considerations 687 6.1. Additional requirements and Implementation notes 689 6.1.1. Servers 691 This document defines an additional capability that is used to announce 692 the list of extra rights (excluding the ones defined in the RFC 2086) 693 supported by the server. The set of rights MUST include "t", "e", "x" 694 and "k". Note that the extra rights can appear in any order. 696 Example: C: 1 capability 697 S: * CAPABILITY IMAP4REV1 STARTTLS LITERAL+ ACL RIGHTS=texk 698 S: 1 OK completed 700 Any server implementing an ACL extension MUST accurately reflect the current 701 user's rights in FLAGS and PERMANENTFLAGS responses. 703 Example: C: A142 SELECT INBOX 704 S: * 172 EXISTS 705 S: * 1 RECENT 706 S: * OK [UNSEEN 12] Message 12 is first unseen 707 S: * OK [UIDVALIDITY 3857529045] UIDs valid 708 S: * OK [UIDNEXT 4392] Predicted next UID 709 S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) 710 S: * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \*)] Limited 711 S: A142 OK [READ-WRITE] SELECT completed 712 C: A143 MYRIGHTS INBOX 713 S: * MYRIGHTS INBOX lrwis 714 S: A143 OK completed 716 Note that in order to get better performance the client MAY pipeline 717 SELECT and MYRIGHTS commands: 719 C: A142 SELECT INBOX 720 C: A143 MYRIGHTS INBOX 721 S: * 172 EXISTS 722 S: * 1 RECENT 723 S: * OK [UNSEEN 12] Message 12 is first unseen 724 S: * OK [UIDVALIDITY 3857529045] UIDs valid 725 S: * OK [UIDNEXT 4392] Predicted next UID 726 S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) 727 S: * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \*)] Limited 728 S: A142 OK [READ-WRITE] SELECT completed 729 S: * MYRIGHTS INBOX lrwis 730 S: A143 OK completed 732 Servers MAY cache the rights a user has on a mailbox when the mailbox 733 is selected, so that if a client's rights on a mailbox are changed with 734 SETACL or DELETEACL, commands specific to the selected state (e.g., STORE, 735 EXPUNGE) might not reflect the changed rights until the mailbox is 736 re-selected. If the server checks the rights on each command, then it SHOULD 737 send FLAGS and PERMANENTFLAGS responses if they have changed. 738 If such server detects that the user no longer has read access to the 739 mailbox, it MAY send an untagged BYE response and close connection. 740 It MAY also refuse to execute all commands specific to the selected state 741 until the mailbox is closed, however server implementors should note that 742 most clients don't handle NO responses very well. 744 An ACL server MAY modify one or more ACL for one or more identifier as a 745 side effect of modifying the ACL specified in a SETACL/DELETEACL. 746 If the server does that it MUST send untagged ACL response(s) to notify the 747 client about the changes made. 749 An ACL server implementation MUST treat received ACL modification commands 750 as a possible ambiguity with respect to subsequent commands affected by the 751 ACL, as described in section 5.5 of [IMAP4]. Hence a pipeline 752 SETACL + MYRIGHTS is an ambiguity with respect to the server, meaning that 753 the server must execute the SETACL command to completion before the MYRIGHTS. 754 However, clients are permitted to send such a pipeline. 756 6.1.2. Clients 758 The following requirement is put on clients in order to allow for 759 future extensibility. 760 A client implementation that allows a user to read and update ACLs MUST 761 preserve unrecognized rights that it doesn't allow the user to change. 762 I.e., if the client 763 1) can read ACLs 764 and 765 2) can update ACLs 766 but 767 3) doesn't allow the user to change the rights the client doesn't recognize, 768 then it MUST preserve unrecognized rights. 769 Otherwise the client could risk unintentionally removing permissions 770 it doesn't understand. 772 6.2. Mapping of ACL rights to READ-WRITE and READ-ONLY response codes 774 A particular ACL server implementation MAY allow "shared multiuser 775 access" to some mailboxes. "Shared multiuser access" to a mailbox means 776 that multiple different users are able to access the same mailbox, 777 if they have proper access rights. "Shared multiuser access" to the 778 mailbox doesn't mean that the ACL for the mailbox is currently set 779 to allow access by multiple users. Let's denote a "shared multiuser 780 write access" as a "shared multiuser access" when a user can be 781 granted flag modification rights (any of "w", "s" or "t"). 783 Section 5 describes which rights are required for modifying different flags. 785 If the ACL server implements some flags as shared for a mailbox (i.e., 786 the ACL for the mailbox MAY be set up so that changes to those flags are 787 visible to another user), let's call the set of rights associated with these 788 flags (as described in Section 5) for that mailbox collectively as 789 "shared flag rights". Note that "shared flag rights" set MAY be different 790 for different mailboxes. 792 If the server doesn't support "shared multiuser write access" to a 793 mailbox or doesn't implement shared flags on the mailbox, "shared flag 794 rights" for the mailbox is defined to be the empty set. 796 Example 1: Mailbox "banan" allows "shared multiuser write access" and 797 implements flags \Deleted, \Answered and $MDNSent as 798 shared flags. "Shared flag rights" for the mailbox "banan" 799 is a set containing flags "t" (because system flag \Deleted 800 requires "t" right) and "w" (because both \Answered and 801 $MDNSent require "w" right). 803 Example 2: Mailbox "apple" allows "shared multiuser write access" and 804 implements \Seen system flag as shared flag. "Shared flag 805 rights" for the mailbox "apple" contains "s" right, 806 because system flag \Seen requires "s" right. 808 Example 3: Mailbox "pear" allows "shared multiuser write access" and 809 implements flags \Seen, \Draft as shared flags. "Shared flag 810 rights" for the mailbox "apple" is a set containing flags "s" 811 (because system flag \Seen requires "s" right) and "w" 812 (because system flag \Draft requires "w" right). 814 The server MUST include a READ-ONLY response code in the tagged OK response to 815 a SELECT command if none of the following rights is granted to the 816 current user: 817 "i", "e" and "shared flag rights"*. 818 The server SHOULD include a READ-WRITE response code in the tagged OK response 819 if at least one of the "i", "e" or "shared flag rights"* is granted to the 820 current user. 822 * - Note that a future extension to this document can extend the list of 823 rights that causes the server to return the READ-WRITE response code. 825 Example 1 (continued): The user that has "lrs" rights for the mailbox 826 "banan". The server returns READ-ONLY response 827 code on SELECT, as none of "iewt" rights is 828 granted to the user. 830 Example 2 (continued): The user that has "rit" rights for the mailbox 831 "apple". The server returns READ-WRITE response 832 code on SELECT, as the user has "i" right. 834 Example 3 (continued): The user that has "rset" rights for the mailbox 835 "pear". The server returns READ-WRITE response 836 code on SELECT, as the user has "e" and "s" rights. 838 7. Security Considerations 840 An implementation MUST make sure the ACL commands themselves do not 841 give information about mailboxes with appropriately restricted ACL's. 842 For example, when a user agent executes a GETACL command on a mailbox 843 that the user has no permission to LIST, the server would respond to that 844 request with the same error that would be used if the mailbox did not exist, 845 thus revealing no existence information, much less the mailbox's ACL. 847 IMAP clients implementing ACL that are able to modify ACLs SHOULD 848 warn a user that wants to give full access (or even just the "a" right) 849 to the special identifier "anyone". 851 8. Formal Syntax 853 Formal syntax is defined using ABNF [ABNF], extending the ABNF rules 854 in section 9 of [IMAP]. The IMAP4 ABNF should be imported first before 855 attempting to validate these rules. 857 Except as noted otherwise, all alphabetic characters are 858 case-insensitive. The use of upper or lower case characters to 859 define token strings is for editorial clarity only. Implementations 860 MUST accept these strings in a case-insensitive fashion. 862 LOWER-ALPHA = %x61-7A ;; a-z 864 acl-data = "ACL" SP mailbox *(SP identifier SP 865 rights) 867 capability =/ rights-capa 868 ;;capability is defined in [IMAP4] 870 command-auth =/ setacl / deleteacl / getacl / 871 listrights / myrights 872 ;;command-auth is defined in [IMAP4] 874 deleteacl = "DELETEACL" SP mailbox SP identifier 876 getacl = "GETACL" SP mailbox 878 identifier = astring 880 listrights = "LISTRIGHTS" SP mailbox SP identifier 882 listrights-data = "LISTRIGHTS" SP mailbox SP identifier 883 SP rights *(SP rights) 885 mailbox-data =/ acl-data / listrights-data / myrights-data 886 ;;mailbox-data is defined in [IMAP4] 888 mod-rights = astring 889 ;; +rights to add, -rights to remove 890 ;; rights to replace 892 myrights = "MYRIGHTS" SP mailbox 894 myrights-data = "MYRIGHTS" SP mailbox SP rights 896 new-rights = 1*LOWER-ALPHA 897 ;; MUST include "t", "e", "x" and "k". 898 ;; MUST NOT include standard rights listed 899 ;; in section 3.2 901 rights = astring 902 ;; only lowercase ASCII letters and digits 903 ;; are allowed. 905 rights-capa = "RIGHTS=" new-rights 906 ;; RIGHTS=... capability 908 setacl = "SETACL" SP mailbox SP identifier 909 SP mod-rights 911 9. IANA Considerations 913 IMAP4 capabilities are registered by publishing a standards track or 914 IESG approved experimental RFC. The registry is currently located 915 at: 917 http://www.iana.org/assignments/imap4-capabilities 919 This document defines the RIGHTS= IMAP capability. IANA is requested 920 to add this capability to the registry. 922 10. Internationalization Considerations 924 Section 4 states requirements on servers regarding internationalization 925 of identifiers. 927 11. References 929 11.1. Normative References 931 [KEYWORDS] Bradner, "Key words for use in RFCs to Indicate 932 Requirement Levels", RFC 2119, Harvard University, March 1997. 934 [ABNF] Crocker, Overell, "Augmented BNF for Syntax Specifications: 935 ABNF", RFC 2234, Internet Mail Consortium, Demon Internet Ltd, 936 November 1997. 938 [IMAP4] Crispin, M., "Internet Message Access Protocol - Version 939 4rev1", RFC 3501, University of Washington, March 2003. 941 [UTF-8] Yergeau, F., "UTF-8, a transformation format of IS0 10646", 942 RFC 3629, Alis Technologies, November 2003. 944 [Stringprep] Hoffman, P., Blanchet, M., "Preparation of 945 Internationalized Strings ("stringprep")", RFC 3454, December 2002. 947 [SASLprep] Zeilenga, K., "SASLprep: Stringprep profile for User Names 948 and Passwords", RFC 4013, February 2005. 950 11.2. Informative References 952 [RFC2086] Myers, J., "IMAP4 ACL extension", RFC 2086, Carnegie Mellon, 953 January 1997. 955 12. Editor's Address 957 Alexey Melnikov 958 email: alexey.melnikov@isode.com 960 Isode Limited 962 13. IPR Disclosure Acknowledgement 964 By submitting this Internet-Draft, each author represents that any 965 applicable patent or other IPR claims of which he or she is aware 966 have been or will be disclosed, and any of which he or she becomes 967 aware will be disclosed, in accordance with Section 6 of BCP 79. 969 14. Intellectual Property Statement 971 The IETF takes no position regarding the validity or scope of any 972 Intellectual Property Rights or other rights that might be claimed 973 to pertain to the implementation or use of the technology 974 described in this document or the extent to which any license 975 under such rights might or might not be available; nor does it 976 represent that it has made any independent effort to identify any 977 such rights. Information on the procedures with respect to rights 978 in RFC documents can be found in BCP 78 and BCP 79. 980 Copies of IPR disclosures made to the IETF Secretariat and any 981 assurances of licenses to be made available, or the result of an 982 attempt made to obtain a general license or permission for the use 983 of such proprietary rights by implementers or users of this 984 specification can be obtained from the IETF on-line IPR repository 985 at http://www.ietf.org/ipr. 987 The IETF invites any interested party to bring to its attention 988 any copyrights, patents or patent applications, or other 989 proprietary rights that may cover technology that may be required 990 to implement this standard. Please address the information to the 991 IETF at ietf-ipr@ietf.org. 993 15. Full Copyright Statement 995 Copyright (C) The Internet Society (2005). 997 This document is subject to the rights, licenses and restrictions 998 contained in BCP 78, and except as set forth therein, the authors 999 retain all their rights. 1001 This document and the information contained herein are provided on an 1002 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1003 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 1004 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 1005 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 1006 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1007 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1009 Acknowledgement 1011 Funding for the RFC Editor function is currently provided by the 1012 Internet Society. 1014 Appendix A. Changes since RFC 2086 1016 1. Changed the charset of "identifier" from US-ASCII to UTF-8. 1018 2. Specified that mailbox deletion is controled by the "x" right and 1019 EXPUNGE is controlled by the "e" right. 1021 3. Added the "t" right that controls STORE \Deleted. Redefined the "d" 1022 right to be a macro for "e", "t" and possibly "x". 1024 4. Added the "k" right that controls CREATE. Redefined the "c" 1025 right to be a macro for "k" and possibly "x". 1027 5. Specified that the "a" right also controls DELETEACL. 1029 6. Specified that the "r" right also controls STATUS. 1031 7. Removed the requirement to check the "r" right for CHECK, SEARCH and 1032 FETCH, as this is required for SELECT/EXAMINE to be successful. 1034 8. LISTRIGHTS requires the "a" right on the mailbox (same as SETACL). 1036 9. Deleted "PARTIAL", this is a deprecated feature of RFC 1730. 1038 10. Specified that the "w" right controls setting flags other than \Seen 1039 and \Deleted on APPEND. Also specified that the "s" right controls 1040 the \Seen flag and that the "t" right controls the \Deleted flag. 1042 11. Specified that SUBSCRIBE is NOT allowed with the "r" right. 1044 12. Specified that the "l" right controls SUBSCRIBE. 1046 13. GETACL is NOT allowed with the "r" right, even though there are 1047 several implementations that allows that. If a user only has "r" 1048 right, GETACL can disclose information about identifiers existing 1049 on the mail system. 1051 14. Clarified that RENAME requires the "k" right for the new parent and 1052 the "x" right for the old name. 1054 15. Added new section that describes which rights are required and/or 1055 checked when performing various IMAP commands. 1057 16. Added mail client security considerations when dealing with special 1058 identifier "anyone". 1060 17. Clarified that negative rights are not the same as DELETEACL. 1062 18. Added "Compatibility with RFC 2086" section. 1064 19. Added section about mapping of ACL rights to READ-WRITE and READ-ONLY 1065 response codes. 1067 20. Changed BNF to ABNF. 1069 21. Added "Implementation Notes" section. 1071 22. Updated "References" section. 1073 23. Added more examples. 1075 24. Clarified when the virtual "c" and "d" rights are returned in ACL, 1076 MYRIGHTS and LISTRIGHTS responses. 1078 Appendix B. Compatibility with RFC 2086 1080 This non-normative section gives guidelines how an existing RFC 2086 1081 server implementation may be updated to comply with this document. 1083 This document splits the "d" right into several new different rights: 1084 "t", "e" and possibly "x" (see section 3.1.1 for more details). The "d" 1085 right remains for backwards-compatibility but it is a virtual right. 1086 There are two approaches for RFC2086 server implementors to 1087 handle the "d" right and the new rights that have replaced it. 1089 a). "t", "e" (and possibly "x) together - almost no changes. 1090 b). Implement separate "x", "t" and "e". Return the "d" right in a 1091 MYRIGHTS response or an ACL response containing ACL 1092 information when any of the "t", "e" (and "x") is granted. 1094 In a similar manner this document splits the "c" right into several 1095 new different rights: "k" and possibly "x" (see section 3.1.1 for more 1096 details). The "c" right remains for backwards-compatibility but it is 1097 a virtual right. Again, RFC2086 server implementors can choose 1098 to tie rights or to implement separate rights, as described above. 1100 Also check Sections 6.1 and 6.2, as well as the appendix A to see 1101 other changes required. Server implementors should check which rights 1102 are required to invoke different IMAP4 commands as described in 1103 Section 5. 1105 Appendix C. Known deficiencies 1107 This specification has some known deficiencies including: 1109 1. This is inadequate to provide complete read-write access to 1110 mailboxes protected by Unix-style rights bits because there is no 1111 equivalent to "chown" and "chgrp" commands nor is there a good way 1112 to discover such limitations are present. 1114 2. Because this extension leaves the specific semantics of how rights 1115 are combined by the server as implementation defined, the ability 1116 to build a user-friendly interface is limited. 1118 3. Users, groups, and special identifiers (e.g. anyone) exist in the 1119 same namespace. 1121 The work-in-progress "ACL2" extension is intended to redesign this 1122 extension to address these deficiencies without the constraint of 1123 backwards-compatibility and may eventually supercede this facility. 1124 However, RFC 2086 is deployed in multiple implementations so this 1125 intermediate step which fixes the straightforward deficiencies in a 1126 backwards compatible fashion is considered worthwhile. 1128 Appendix D. Acknowledgment 1130 This document is a revision of the RFC 2086 written by John G. Myers. 1132 Editor appreciates comments received from Mark Crispin, Chris Newman, 1133 Cyrus Daboo, John G. Myers, Dave Cridland, Ken Murchison, Steve Hole, 1134 Vladimir Butenko, Larry Greenfield, Robert Siemborski, Harrie 1135 Hazewinkel, Philip Guenther, Brian Candler, Curtis King, Lyndon 1136 Nerenberg, Lisa Dusseault, Arnt Gulbrandsen and other participants 1137 of the IMAPEXT working group.