Internet Draft A. Melnikov Document: draft-melnikov-imap-ext-abnf Isode Ltd Expires: September 2005 March 2005 Collected extensions to IMAP4 ABNF draft-melnikov-imap-ext-abnf-00 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. A revised version of this draft document will be submitted to the RFC editor as a Standard Track RFC for the Internet Community. Discussion and suggestions for improvement are requested, and should be sent to ietf-imapext@imc.org and/or lemonade@ietf.org. Distribution of this memo is unlimited. Abstract Over years many documents from IMAPEXT and LEMONADE working groups, as well as many individual documents have added syntactic extensions to many base IMAP commands described in RFC 3501. For ease of reference this document collects most of such ABNF changes in one place. This document updates ABNF in RFC 3501. Table of Contents 1. Conventions Used in this Document 2 2. IMAP ABNF extensions 2 2.1 Optional parameters with the SELECT/EXAMINE commands 2 2.2 Extensions to FETCH and UID FETCH Commands 3 2.3 Extensions to STORE and UID STORE Commands 4 2.4 Extensions to SEARCH Command 4 3. Formal Syntax 5 4. Security Considerations 7 5. IANA Considerations 7 6. References 7 6.1 Normative References 7 7. Acknowledgments 7 8. Author's Addresses 8 9. Full Copyright Statement 8 10. Intellectual Property 8 11. Appendix A. Editorial. 9 11.1 Change Log 9 1. Conventions Used in this Document In examples, "C:" and "S:" indicate lines sent by the client and server respectively. The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" in this document are to be interpreted as defined in "Key words for use in RFCs to Indicate Requirement Levels" [KEYWORDS]. <> 2. IMAP ABNF extensions 2.1 Optional parameters with the SELECT/EXAMINE commands This documents adds the ability to include one or more parameters with the IMAP SELECT or EXAMINE commands, to turn on or off certain standard behaviour, or to add new optional behaviours required for a particular extension. There are two possible modes of operation: o A global state change where a single use of the optional parameter will effect the session state from that time on, irrespective of subsequent SELECT/EXAMINE commands. o A per-mailbox state change that will effect the session only for the duration of the new selected state. A subsequent SELECT/ EXAMINE without the optional parameter will cancel its effect For the newly selected mailbox. Optional parameters to the SELECT or EXAMINE commands are added as a parenthesised list of atoms or strings, and appear after the mailbox name in the standard SELECT or EXAMINE command. The order of individual parameters is arbitrary. Individual parameters may consist of one or more atoms or strings in a specific order. If a parameter consists of more than one atom or string, it MUST appear in its own parenthesised list. Any parameter not defined by extensions that the server supports MUST be rejected with a NO response. Example: C: a SELECT INBOX (ANNOTATE) S: ... S: a OK SELECT complete In the above example, a single parameter is used with the SELECT command. Example: C: a EXAMINE INBOX (ANNOTATE (RESPONSES "UID Responses") CONDSTORE) S: ... S: a OK EXAMINE complete In the above example, three parameters are used with the EXAMINE command. The second parameter consists of two items: an atom followed by a quoted string. Example: C: a SELECT INBOX (BLURDYBLOOP) S: a NO Unknown parameter in SELECT command In the above example, a parameter not supported by the server is incorrectly used. 2.2 Extensions to FETCH and UID FETCH Commands Arguments: sequence set message data item names or macro OPTIONAL fetch modifiers Responses: untagged responses: FETCH Result: OK - fetch completed NO - fetch error: can't fetch that data BAD - command unknown or arguments invalid This document extends the syntax of the FETCH and UID FETCH commands (see section 6.4.5 of [IMAP4]) to include optional FETCH modifiers. No fetch modifiers are defined in this document. 2.3 Extensions to STORE and UID STORE Commands Arguments: message set OPTIONAL store modifiers message data item name value for message data item Responses: untagged responses: FETCH Result: OK - store completed NO - store error: can't store that data BAD - command unknown or arguments invalid This document extends the syntax of the STORE and UID STORE commands (see section 6.4.6 of [IMAP4]) to include optional STORE modifiers. No store modifiers are defined in this document. 2.4 Extensions to SEARCH Command Arguments: OPTIONAL result specifier OPTIONAL [CHARSET] specification searching criteria (one or more) Responses: REQUIRED untagged response: SEARCH or ESEARCH Result: OK - search completed NO - search error: can't search that [CHARSET] or criteria BAD - command unknown or arguments invalid This section updates definition of the SEARCH command described in section 6.4.4 of [IMAP4]. The SEARCH command is extended to allow for result options. This document doesn't define any result option. 3. Formal Syntax The following syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [ABNF]. Non-terminals referenced but not defined below are as defined by [IMAP4]. 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. append = "APPEND" SP mailbox 1*append-message ;; only a single append-message may appear ;; if MULTIAPPEND [MULTIAPPEND] capability ;; is not present append-message = append-opts SP append-data append-ext = ;; is arbitrary bounded syntax to be defined ;; by extensions. This MUST start with an ;; an atom. append-data = literal append-opts = [SP flag-list] [SP date-time] *(SP append-ext) examine = "EXAMINE" SP mailbox [select-params] ;; modifies the original IMAP EXAMINE command ;; to accept optional parameters fetch = "FETCH" SP sequence-set SP ("ALL" / "FULL" / "FAST" / fetch-att / "(" fetch-att *(SP fetch-att) ")") [SP fetch-modifiers] ;; modifies the original IMAP4 FETCH command to ;; accept optional modifiers fetch-modifiers = "(" fetch-modifier *(SP fetch-modifier) ")" fetch-modifier = fetch-modifier-name / fetch-modifier-name SP astring / fetch-modifier-name SP "(" fetch-modif-params ")" ;; modifiers to FETCH may contain a modifier ;; name followed by zero or more atoms or ;; strings - multiple items are always ;; parenthesised, nesting is allowed fetch-modif-params = astring *(SP astring) / "(" fetch-modif-params *(SP fetch-modif-params) ")" fetch-modifier-name = atom search = "SEARCH" [search-return-opts] [SP "CHARSET" SP astring] 1*(SP search-key) ;; CHARSET argument to MUST be registered ;; with IANA search-return-opts = "RETURN" SP "(" [search-return-opt *(SP search-return-opt)] ")" ;; SEARCH return options, e.g. MIN search-return-opt = search-modifier-name [SP "(" search-mod-params ")"] search-modifier-name = atom search-mod-params = astring / search-mod-params *(SP search-mod-params) / "(" search-mod-params ")" ;; same structure as for store-modparam-comp select = "SELECT" SP mailbox [select-params] ;; modifies the original IMAP SELECT command to ;; accept optional parameters select-params = SP "(" select-param *(SP select-param) ")" select-param = astring / "(" astring 1*(SP astring) ")" ;; parameters to SELECT may contain one or ;; more atoms or strings - multiple items ;; are always parenthesised status = "STATUS" SP mailbox SP "(" status-att-req *(SP status-att-req) ")" ;; redefine STATUS command syntax defined in ;; [IMAP4] status-att-list = status-rsp-info *(SP status-rsp-info) ;; Redefines status-att-list from RFC 3501 status-att-req = status-att status-rsp-info = status-att SP number store = "STORE" SP sequence-set store-modifiers SP store-att-flags ;; extend [IMAP4] STORE command syntax ;; to allow for optional store-modifiers store-modifiers = [ SP "(" store-modifier *(SP store-modifier) ")" ] store-modifier = store-modifier-name [SP store-modif-params] ;; MUST start with atom (label) store-modif-params = astring / "(" store-modparam-comp ")" store-modparam-comp = astring / store-modparam-comp *(SP store-modparam-comp) / "(" store-modparam-comp ")" <> store-modifier-name = atom <