IMAPEXT Working Group A. Melnikov Internet Draft Editor Document: draft-ietf-imapext-acl-10.txt July 2004 Expires: January 2005 IMAP4 ACL extension Status of this Memo By submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, or will be disclosed, and any of which I become aware will be disclosed, in accordance with RFC 3668. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its Areas, and its Working Groups. Note that other groups may also distribute working documents as Internet Drafts. Internet Drafts are draft documents valid for a maximum of six months. Internet Drafts may be updated, replaced, or obsoleted by other documents at any time. It is not appropriate to use Internet Drafts as reference material or to cite them other than as ``work in progress''. The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or munnari.oz.au. A revised version of this draft document will be submitted to the RFC editor as a Proposed Standard for the Internet Community. Discussion and suggestions for improvement are requested. Distribution of this draft is unlimited. 0. Open issues and ToDo list This section will be removed when the draft will be published as RFC. It is intended to simplify discussion. 1). Require support for special identifier "disabled" for "ACL2=MOST-SPECIFIC" model? Can the same result be achieved with ? 2). Do we need a special command for inserting at any position (this is meaningless for the MOST-SPECIFIC model only). 3). IANA registry for prefix in identifiers? 4). Do we need the following functionality: discover the set of rights which may be granted to a given identifier in the ACL for a given mailbox? 5). Cleanup appendix A before publication as RFC, as some changes don't apply to RFC 2086. 6). Other editorial comments/questions are enclosed in << and >>. Table of Contents 1 Abstract .................................................. X 2 Conventions Used in this Document ......................... X 3 Introduction and Overview ................................. X 3.1 Access Control ........................................... X 3.2 Access calculation model ................................. X 3.3 Rights required to perform different IMAP4rev1 commands .. X 4 ACL manipulation commands ................................. X 4.1 ACL STORE ................................................ X 4.2 ACL DELETE ............................................... X 4.3 ACL SET .................................................. X 4.4 LIST with the ACL parameter .............................. X 4.5 LIST with the MYRIGHTS parameter ......................... X 5 ACL related responses ..................................... X 5.1 Extended LIST response with ACL information .............. X 5.2 RIGHTS-INFO .............................................. X 5.3 ACLFAILED untagged response .............................. X 5.4 Extended LIST response with MYRIGHTS information ......... X 5.5 MYRIGHTS response code ................................... X 6 Formal Syntax ............................................. X 7 IANA considerations ....................................... X 7.1 ACL access calculation rule Registration Template ........ X 7.2 Initial Registrations .................................... X 7.2.1 Registration: UNION access calculation rule ............ X 7.2.2 Registration: MOST-SPECIFIC access calculation rule .... X 8 Security Considerations ................................... X 9 Other considerations ...................................... X 9.1 Compatibility with RFC 2086 .............................. X 9.2 Mapping of ACL rights to READ-WRITE and READ-ONLY response codes ........................................... X 9.4 Additional requirements and Implementation notes ......... X 10 Normative References ..................................... X 11 Informative References ................................... X 12 Aknowledgement ........................................... X 13 Editor's Address ......................................... X 14 Full Copyright Statement ................................. X 1. Abstract The ACL (Access Control List) extension of the Internet Message Access Protocol [IMAP4] permits mailbox access control lists to be manipulated through the IMAP protocol. 2. Conventions Used in this Document In examples, "C:" and "S:" indicate lines sent by the client and server respectively. In all examples "/" character is used as hierarchy separator. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [KEYWORDS]. 3. Introduction and Overview The ACL (Access Control List) extension of the Internet Message Access Protocol [IMAP4] permits mailbox access control lists to be retrieved and manipulated through the IMAP protocol. The ACL extension is present in any IMAP4 implementation which returns a capability starting with "ACL2=" prefix as one of the supported capabilities to the CAPABILITY command. The prefix is followed by "rule identifier" as described in 7.1. <> The document contains the following parts: section 3.1 provides the definition of different classes of identifiers and defines standard rights; section 3.2 introduces access calculation model, i.e. it describes how to calculate from an ACL which rigths apply to a particular user; section 3.3 summarizes relationship of different access rights with IMAP commands; section 4 introduces new IMAP commands the client can use to manipulate ACLs; section 5 defines new ACL related responses; and section 9 lists important considerations for compatibility with [IMAP4], RFC 2086 and some IMAP extensions. 3.1. Access Control An access control list is an ordered list of pairs. An ACL applies to a mailbox. Identifier is a UTF-8 string. An identifier may have one of the following forms: a). "anonymous" - special group that refers to the universal identity (all authentications, including anonymous). A special identifier "anyone" is a synonym for the "anonymous". b). "authuser" - special group that refer to all authenticated users, but not anonymous. c). "owner" - special user identifier that refers to the owner of a mailbox (if any). d). "administrators" - special group that refers to all users with administrative rights for the server. e). "user=" - refers to a user. Here "" is a user name string accepted by the LOGIN or AUTHENTICATE commands. f). "group=" - refers to a group. Here "" is a group name. g). "vendor=." - refers to a vendor specific special identifier, not covered by a).-f). h). "-", where is one of a).-g). This is reserved for "negative rights", described below. Note, that a server is not required to implement any special identifier mentioned above. However if it allows a user to perform ACL operations on any one of them, server MUST use the semantic as described above. Also note, that this document doesn't define how groups and administrators are managed. All other identifier names are reserved for future definition in an extension or revision to this specification (also known as ACL2). Rights is a string listing a (possibly empty) set of alphanumeric characters, each character listing a set of operations which is being controlled. Letters are reserved for ''standard'' rights, listed below. The set of standard rights may only be extended by a standards-track document. Digits are reserved for implementation or site defined rights. The currently defined standard rights are: l - lookup (mailbox is visible to LIST/LSUB commands, SUBSCRIBE mailbox) r - read (SELECT the mailbox, perform STATUS, CHECK, FETCH, SEARCH, COPY from mailbox) s - keep seen/unseen information across sessions (set or clear \SEEN flag via STORE, APPEND or COPY) w - write (set or clear flags other than \SEEN and \DELETED via STORE, APPEND or COPY) i - insert (perform APPEND, COPY into mailbox) p - post (send mail to submission address for mailbox, not enforced by IMAP4 itself. c - create mailboxes (CREATE new sub-mailboxes in any implementation-defined hierarchy, parent mailbox for the new mailbox name in RENAME) When a new mailbox is created it SHOULD inherit rights from the parent mailbox (if one exists) in the defined hierarchy. x - delete mailbox (DELETE mailbox, old mailbox name in RENAME) t - delete messages (set or clear \DELETED flag via STORE, set \DELETED flag during APPEND/COPY) e - perform EXPUNGE and expunge as a part of CLOSE d - This right is defined for backward compatibility with ACL extension (RFC 2086). If a client sets "d" right, the server MUST set "x", "e" and "t" rights. When the client clears the "d" right, the server MUST clear "x", "e" and "t" rights. When all three of "x", "e" and "t" are set, the server MUST return "d" right in response to a LIST (ACL) command. If "x", "e" and "t" rights are not tied together, "d" right MUST NOT be returned in a RIGHTS-INFO response. a - administer (perform ACL STORE, ACL SET and ACL DELETE) An implementation may tie rights together or may force rights to always or never be granted to particular identifiers. For example, in an implementation that uses unix mode bits, the rights "swite" are tied, the "a" right is always granted to the owner of a mailbox and is never granted to another user. If rights are tied in an implementation, the implementation must be conservative in granting rights in response to ACL STORE commands--unless all rights in a tied set are specified, none of that set should be included in the ACL entry for that identifier. If the server fails an ACL modification command (ACL STORE or ACL SET) because some rights are tied, it MUST return RIGHTS-INFO untagged response (see section 5.2). When an identifier in an ACL starts with a dash ("-"), that indicates that associated rights are to be removed from the identifier that is prefixed by the dash. This is referred to as a "negative right". This differs from ACL DELETE in that a negative right is added to the ACL, and is part of the calculation of the rights. For example, if the identifier "-user=fred" is granted the "w" right, that indicates that the "w" right is to be removed from users matching the identifier "user=fred", even though the user "fred" might have the "w" right as a consequence of some other identifier in the ACL. A ACL DELETE of "user=fred" simply deletes the identifier "user=fred" from the ACL; it does not affect any rights that the user "fred" may get from another ACL. Server implementations are not required to support "negative right" identifiers. 3.2. Access calculation model It is possible for multiple identifiers in an access control list to apply to a given user (or other authentication identity). For example, an ACL may include rights to be granted to the identifier matching the user, one or more implementation-defined identifiers matching groups which include the user, and/or the identifier "anyone". How these rights are combined to determine the user's access is implementation-defined. The set of rules that describes how access is calculated is defined by a rule identifier (rule-ID). This document doesn't define any commands for manipulating a group membership. A client may determine the set of rights granted to the logged-in user for a given mailbox by using the LIST (MYRIGHTS) command. This document defines two initial access calculation models: UNION and MOST-SPECIFIC. If a server implementing ACL2 uses the union of the rights granted to the applicable identifiers minus the union of the negative rights in order to calculate access, it MUST report "ACL2=UNION" in the server's capability list. See also section 7.2.1. An implementation may instead choose to only use those rights granted to the most specific identifier present in the ACL. In this case the server MUST report "ACL2=MOST-SPECIFIC" in the server's capability list. See also section 7.2.2. If the server implements any other policy for rights calculation, it MUST be either registered with IANA using the template provided in 7.1 or start with "X-". The server MUST report one and only one "ACL2=" capability in its CAPABILITY response. 3.3. Rights required to perform different IMAP4rev1 commands Before executing a command an ACL2 compliant server must check which rights are required to perform it. This section groups command by functions they perform and list the rights required. It also gives the detailed description of any special processing required. The table below summarizes different rights or their combinations that are required in order to perform different IMAP operations. As it is not always possible to express complex right checking and interactions, the description after the table should be used as the primary reference. +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ | Operations\Rights | l | r | s | w | i | c | x | t | e | a | Any | None | +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ | LIST | + | | | | | | | | | | | | | SUBSCRIBE | * | | | | | | | | | | | * | | UNSUBSCRIBE | | | | | | | | | | | | + | | LSUB | * | | | | | | | | | | | * | | CREATE (for parent) | | | | | | + | | | | | | | | DELETE | | | | | | | + | | | | | | | RENAME | | | | | | + | + | | | | | | | COPY/APPEND | | | ? | ? | + | | | ? | | | | | | EXPUNGE/CLOSE | | | | | | | | | + | | | | |SELECT/EXAMINE/STATUS| | | | | | | | | | | | | | FETCH | | | ? | | | | | | | | | | | STORE flags | | | ? | ? | | | | ? | | | | | |ACL STORE/DELETE/SET | ? | | | | | | | | | + | | | | LIST (ACL) | ? | | | | | | | | | + | | | | LIST (MYRIGHTS)| | | | | | | | | | | + | | +---------------------+---+---+---+---+---+---+---+---+---+---+-----+------+ Legend: + - The right is required * - Only one of the rights marked with * is required (see description below) ? - The right is optional (see description below) "Any" - at least one of the "l", "r", "i", "c", "x", "e", "a" rights is required "None" - No rights required to perform the command Listing and subscribing/unsubscribing mailboxes: LIST - "l" right is required. Note, that if the user has "l" right to a mailbox "A/B", but not to its parent mailbox "A", the LIST command should behave as if the mailbox "A" doesn't exist, for example: C: A777 LIST "" * S: * LIST (\NoInferiors) "/" "A/B" S: * LIST () "/" "C" S: * LIST (\NoInferiors) "/" "C/D" S: A777 OK LIST completed SUBSCRIBE - "l" right is required only if the server checks for mailbox existence when performing SUBSCRIBE. UNSUBSCRIBE - no rights required to perform this operation. LSUB - "l" right is required only if the server checks for mailbox existence when performing SUBSCRIBE. Mailbox management: CREATE - "c" right on a nearest existing parent mailbox. When a new mailbox is created it SHOULD inherit rights from the parent mailbox (if one exists) in the defined hierarchy. DELETE - "x" right on the mailbox. RENAME - Moving a mailbox from one parent to another requires "x" right on the mailbox itself and "c" right for the new parent. For example, if the user wants to rename mailbox named "A/B/C" to "D/E", the user must have "x" right for the mailbox "A/B/C" and "c" right for the mailbox "D". Copying or appending messages: Before performing a COPY/APPEND command the server MUST check if the user has "i" right for the target mailbox. If the user doesn't have "i" right, the operation fails. Otherwise for each copied/appended message the server MUST check if the user has "t" right - when the message has \Deleted flag set "s" right - when the message has \Seen flag set "w" right for all other message flags. Only when the user has a particular right the corresponding flags are stored for the newly created message. The server MUST NOT fail a COPY/APPEND if the user has no rights to set a particular flag. Example: C: A003 LIST (MYRIGHTS) "" TargetMailbox S: * LIST () "/" TargetMailbox (("MYRIGHTS" "rwis")) S: A003 OK Myrights complete C: A004 FETCH 1:3 (FLAGS) S: * 1 FETCH (FLAGS (\Draft \Deleted) S: * 2 FETCH (FLAGS (\Answered) S: * 3 FETCH (FLAGS ($Forwarded \Seen) S: A004 OK Fetch Completed C: A005 COPY 1:3 TargetMailbox S: A005 OK Copy completed C: A006 SELECT TargetMailbox ... S: A006 Select Completed Let's assume that the copied messages received message numbers 77:79. C: A007 FETCH 77:79 (FLAGS) S: * 77 FETCH (FLAGS (\Draft)) S: * 78 FETCH (FLAGS (\Answered)) S: * 79 FETCH (FLAGS ($Forwarded \Seen)) S: A007 OK Fetch Completed \Deleted flag was lost on COPY, as the user has no "t" right in the target mailbox. If the LIST (MYRIGHT) command with the tag A003 would have returned: S: * LIST () "/" TargetMailbox (("MYRIGHTS" "rsti")) the response from the FETCH with the tag A007 would have been: C: A007 FETCH 77:79 (FLAGS) S: * 77 FETCH (FLAGS (\Deleted)) S: * 78 FETCH (FLAGS ()) S: * 79 FETCH (FLAGS (\Seen)) S: A007 OK Fetch Completed In the latter case \Answered, $Forwarded and \Draft flags were lost on COPY, as the user has no "w" right in the target mailbox. Expunging the selected mailbox: EXPUNGE - "e" right on the selected mailbox. CLOSE - "e" right on the selected mailbox. If the server is unable to expunge the mailbox because the user doesn't have the "e" right, the server MUST ignore expunge request, close the mailbox and return tagged OK response. Fetch information about a mailbox and its messages: SELECT/EXAMINE/STATUS - "r" right on the mailbox. FETCH - A FETCH request that implies setting \Seen flag MUST NOT set it, if the current user doesn't have "s" right. Changing flags: STORE - the server MUST check if the user has "t" right - when the user modifies \Deleted flag "s" right - when the user modifies \Seen flag "w" right for all other message flags. STORE operation SHOULD NOT fail if the user has rights to modify at least one flag specified in the STORE. Changing ACLs: ACL STORE/DELETE/SET - "a" right on the mailbox (*). Reading ACLs: LIST (ACL) - "a" right on the mailbox (*). LIST (MYRIGHTS) - any of the following rights is required to perform the operation: "l", "r", "i", "c", "x", "e", "a". (*) Note, that when one or more mailbox pattern is specified, 'l' right is required for each mailbox matching the mailbox pattern(s). 4. ACL manipulation commands All ACL commands (i.e. ACL STORE/DELETE/SET) accept either a single mailbox name or several mailbox patterns as a parameter. Mailbox pattern is a mailbox with wildcards, wildcards are interpreted as described in [IMAP4] LIST command. In order to distinguish between a mailbox name (that is allowed to have wildcard characters '*' and '%') and a mailbox pattern, the latter is always represented as a parenthesized list. For simplicity the behaviour of ACL STORE/DELETE/SET commands is described for a single mailbox case. When one or more mailbox pattern is specified, the server internally performs LIST command for all specified patterns and than it combines the results. Note, that only mailboxes for which the user has 'l' right are included in the combined result. If the combined result has no mailboxes, an ACL operation completes with success and the tagged OK response is sent. Otherwise the requested operation is performed for each mailbox in the combined result. If a particular mailbox causes the operation to fail (e.g. insufficient permissions), instead of failing the whole command, an untagged ACLFAILED or RIGHTS-INFO response is sent for this mailbox and the operation continues for the rest of the mailboxes. If the server knows that the operation will fail in the same manner for all matching mailboxes (e.g. user doesn't exist), it SHOULD return tagged NO response instead of sending several untagged ACLFAILED responses. Example: In the example below ACL SET command fails for 2 mailboxes "Personal/Jokes" and "Personal/Deaf and Blind". For the latter a human readable error description is returned. Also, the ACL for the mailbox "Personal/Secret" was updated to include the "r" right for a user "user=Boss" as a side effect of the ACL SET command (see also 4.3). C: A002 ACL SET (INBOX Personal/*) user=Fred rwist S: * ACLFAILED Personal/Jokes S: * ACLFAILED "Personal/Deaf and Blind" Temporary Error S: * LIST () "/" Personal/Secret (("ACL" (("user=Boss" "r")))) S: A002 OK acl set completed Example: C: A002 ACL SET (Fruits/Apples/*) user=Zak lrs S: A002 NO User Zak doesn't exist 4.1. ACL STORE Arguments: mailbox name or one or more mailbox masks authentication identifier access right modification Data: OPTIONAL untagged responses: LIST with ACL information (see 5.1) Result: OK - ACL STORE completed NO - ACL STORE failure: can't set acl BAD - command unknown or arguments invalid The ACL STORE command changes the access control list on the specified mailbox so that the specified identifier is granted permissions as specified in the third argument. The third argument is a string containing an optional plus ("+") or minus ("-") prefix, followed by zero or more rights characters. If the string starts with a plus, the following rights are added to any existing rights for the identifier. If the string starts with a minus, the following rights are removed from any existing rights for the identifier. If the string does not start with a plus or minus, the rights replace any existing rights for the identifier. The combined rights will be called the "resulting" rights. If before execution of the command the identifier is not present in the ACL, the pair is added to the end of the ACL. Otherwise it replaces the rights for the identifier, with the resulting rights. Note, that for the "ACL2=UNION" access calculation model the rule MUST be treated as . Also note that these two commands don't have the same result for the "ACL2=MOST-SPECIFIC" access calculation model. An ACL2 server MAY modify one or more ACL for one or more identifier ("additional modifications") as a side effect of modifying the ACL specified in ACL STORE. For example, in some mail stores, a mailbox can be a member of only one group. For such mailstore, doing an ACL STORE that sets a different group from what is already in the ACL MAY have the effect of doing an implicit ACL DELETE of the existing group's identifier/rights pair. If the server does additional modification it MUST send untagged LIST response with ACL information (see section 5.1) to notify the client about the changes made. If the server is unwilling to perform the command, because some rights for the identifier are tied, it MUST return RIGHTS-INFO untagged response (see section 5.2). Example: C: A002 ACL STORE ~/Mail/saved user=smith cp S: * RIGHTS-INFO ~/Mail/saved user=smith la r swi cdext p S: A002 NO Acl store failed, some rights are tied Client decides to grant both rights to the identifier: C: A003 ACL STORE ~/Mail/saved user=smith cdextp S: A003 OK Setacl complete The following example demonstrates behaviour of a mail store that allows a mailbox to be a member of only one group: C: B001 LIST (ACL) "" INBOX S: * LIST () "/" INBOX (("ACL" (("user=Fred" "rwipslextda") ( "group=Devel" "rwipslt")))) S: B001 OK List with acl info completed C: B002 ACL STORE Inbox group=PSO rwipslte S: * LIST () "/" INBOX (("ACL" (("user=Fred" "rwipslextda") ( "group=PSO" "rwipslte")))) S: B002 OK Setacl complete 4.2. ACL DELETE Arguments: mailbox name or one or more mailbox masks authentication identifier Data: OPTIONAL untagged responses: LIST with ACL information (see 5.1) Result: OK - ACL DELETE completed NO - ACL DELETE failure: can't delete acl BAD - command unknown or arguments invalid The ACL DELETE command removes any pair for the specified identifier from the access control list for the specified mailbox. An ACL2 server MAY modify one or more ACL for one or more identifier as a side effect of modifying the ACL specified in ACL DELETE. If the server does that it MUST send untagged LIST response with ACL information (see section 5.1) to notify the client about the changes made. 4.3. ACL SET Arguments: mailbox name or one or more mailbox masks list of (authentication identifier, access rights) pairs Data: OPTIONAL untagged responses: LIST with ACL information (see 5.1) Result: OK - replaceacl completed NO - replaceacl failure: can't replace acl BAD - command unknown or arguments invalid The ACL SET command replaces the access control list of the specified mailbox with the one provided as the second parameter to ACL SET. This command is semantically equivalent to the following sequence of commands: 1). LIST (ACL) "" 2). For each (authentication identifier AID, access rights RD) pair returned in the untagged LIST response that was caused by LIST (ACL), perform ACL DELETE AID 3). For each (authentication identifier AIA, access rights RA) pair from the second parameter of ACL SET perform ACL STORE AIA RA An ACL2 server MAY modify one or more ACL for one or more identifier as a side effect of modifying the ACL specified in ACL SET. If the server does that it MUST send untagged LIST response with ACL information (see section 5.1) to notify the client about the changes made. If the server is unwilling to perform the command, because some rights for an identifier from the second list parameter are tied, it MUST return RIGHTS-INFO untagged response (see section 5.2). 4.4. LIST with the ACL parameter This document defines a new option ACL to the LIST command that requests the server to return the corresponding ACLs for all mailboxes that match the LIST mailbox name. The ACL option causes the server to return LIST with the ACL information (see 5.1). <> Example: C: A002 LIST (ACL) "" INBOX S: * LIST () "/" INBOX (("ACL" (("user=Fred" "rwipslextda")))) S: A002 OK List with acl info completed 4.5. LIST with the MYRIGHTS parameter This document defines a new option MYRIGHTS to the LIST command that requests the server to return the set of rights that the user has to a mailbox, that matches the LIST mailbox name. The MYRIGHTS option causes the server to return LIST with MYRIGHTS information (see 5.4). The user must have any of the following rights to perform this operation: "l", "r", "i", "c", "x", "e", "a". If the user doesn't have any right from the above list, the server MUST behave as if the mailbox doesn't exist. Example: C: A002 LIST (MYRIGHTS) "" INBOX S: * LIST () "/" INBOX (("MYRIGHTS" "rwipsldexta")) S: A002 OK List with acl info completed 5. ACL related responses 5.1. Extended LIST response with ACL information Contents: name attributes hierarchy delimiter mailbox name ACL information (zero or more identifier rights pairs) This version of LIST response occurs as a result of an LIST (ACL) command. It MAY also occur as a result of ACL STORE/DELETE/SET. The proposed syntax conforms to the syntax of an extended LIST response as defined by mbox-list-extended ABNF element of [LISTEXT]. The meaning of "name attributes" and "hierarchy delimiter" is described in section 7.2.2 of [IMAP4]. Hierarchy delimiter is followed by a mailbox name which this ACL applies to. This is followed by the extension part that includes "ACL" tag followed by zero or more pairs of strings, each pair contains the identifier followed by the set of rights that the identifier has. <> Example: S: * LIST () "/" INBOX (("ACL" (("user=Fred" "rwipslextda")))) The example above shows that a user Fred is granted "rwipslextda" rights to the mailbox "INBOX". S: * LIST () ":" Drafts (("ACL" (("user=Fred" "rwipslextda") ("group=Devel" "r")))) The example above shows that a user Fred is granted "rwipslextda" rights and a member of a group "Devel" is granted "r" right to the mailbox "Drafts". S: * LIST () NIL Manson (("ACL" NIL)) The example above shows the mailbox "Manson" has an empty ACL. 5.2. RIGHTS-INFO Data: mailbox name identifier required rights list of optional rights The RIGHTS-INFO response occurs as a result of a failed ACL STORE or ACL SET command. The first two strings are the mailbox name and identifier for which this rights list applies. Following the identifier is a string containing the (possibly empty) set of rights the identifier will always be granted in the mailbox. Following this are zero or more strings each containing a set of rights the identifier may be granted in the mailbox. Rights mentioned in the same string are tied together--either all must be granted to the identifier in the mailbox or none may be granted. The same right may not be listed more than once in the RIGHTS-INFO response. 5.3. ACLFAILED untagged response Contents: mailbox name OPTIONAL response code and human readable text for failure reason The ACLFAILED response containing a mailbox name indicates that the ACL operations failed for the specified mailbox. The reason for failure may be described by the response code (if included). If the command for the mailbox fails because some rights are tied, the server MUST return RIGHTS-INFO response instead of ACLFAILED. Example: C: A002 ACL SET (INBOX Personal/*) user=Fred rwist S: * ACLFAILED Personal/ABC S: A002 OK acl set complete 5.4. Extended LIST response with MYRIGHTS information Contents: name attributes hierarchy delimiter mailbox name MYRIGHTS information (list of rights) This version of LIST response occurs as a result of a LIST (MYRIGHTS) command. The proposed syntax conforms to the syntax of an extended LIST response as defined by mbox-list-extended ABNF element of [LISTEXT]. The meaning of "name attributes" and "hierarchy delimiter" is described in section 7.2.2 of [IMAP4]. This is followed by the extension part that includes "MYRIGHTS" tag followed by the set of rights that the user has. <> Example: S: * LIST () "/" Sent (("MYRIGHTS" "lrwiste")) 5.5. MYRIGHTS response code Data: rights The MYRIGHTS response code is sent in an untagged OK response that results from SELECT/EXAMINE. Also this response code can be sent at any time after opening a mailbox when the server detects that the set of rights allowed for the logged in user has changed. The MYRIGHTS response code is equivalent to the MYRIGHTS data returned in an untagged LIST response for the selected mailbox. 6. Formal Syntax Formal syntax is defined using ABNF [ABNF] as modified by [IMAP4]. Non-terminals referenced but not defined below are as defined by [IMAP4] or [LISTEXT]. Except as noted otherwise, all alphabetic characters are case-insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion. acl2_command = "ACL" SP acl2_subcommand | list acl2_subcommand = replaceacl | deleteacl | updateacl acl_list_data = "(" acl_list_tag SP acl_data ")" ;; acl_list_data conforms to the syntax of ;; mbox-list-extended-item from [LISTEXT] acl_list_tag = <"> "ACL" <"> ace = "(" identifier SP rights ")" acl_data = "NIL" | acl_data_nonemp ;; NIL, or one or more parenthesized identifier/rights pairs acl_data_nonemp = "(" ace *( SP ace ) ")" always_granted = rights deleteacl = "DELETE" SP mbox_or_pat SP identifier option =/ "ACL" | "MYRIGHTS" ;;