Network Working Group C. Newman Internet Draft: IMAP URL Scheme Innosoft Document: draft-newman-url-imap-00.txt October 1996 IMAP URL Scheme Status of this memo This document is an Internet Draft. 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 a ``working draft'' or ``work in progress``. To learn the current status of any Internet-Draft, please check the 1id-abstracts.txt listing contained in the Internet-Drafts Shadow 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. This document will expire six months after publication. Distribution of this draft is unlimited. 1. Introduction IMAP [IMAP4] is a rich protocol for accessing remote message stores. It provides an ideal mechanism for accessing public mailing list archives as well as private and shared message stores. This document defines a URL scheme for referencing objects on an IMAP server. 2. IMAP scheme The IMAP URL scheme is used to designate mailboxes, messages, files, and search programs on Internet hosts accessible using the IMAP protocol. Newman [Page 1] Internet Draft IMAP URL Scheme October 1996 The IMAP URL follows the common Internet scheme syntax as defined in RFC 1738 [RFC1738]. If : is omitted, the port defaults to 143. An IMAP URL takes one of the following forms: imap:///;type= imap:////? imap://////
The first form is used to refer to a list of mailboxes, the second form refers to a list of messages, and the final form refers to a specific message or message part. The characters ";", "?", and "/" are reserved, and must be encoded if present in the , , or . 3. IMAP Name and Password A user name and password may be supplied. They are used in the "LOGIN" command after making the connection to the IMAP server. If no user name or password is supplied, the user name "anonymous" is used and the password is supplied as the Internet e-mail address of the end user accessing the resource. If the URL supplies a user name but no password, the program interpreting the IMAP URL should request one from the user. 4. Lists of mailboxes An IMAP URL referring to a list of mailboxes has the following form: imap:///;type= The may be either "LIST" or "LSUB", and is case insensitive. The field ";type=" may be omitted, in which case ";type=LIST" is assumed. The is any argument suitable for the list_mailbox field of the IMAP [IMAP4] LIST or LSUB commands. The field "/" may be omitted, in which case the program interpreting the IMAP URL may use "*" or "%" as the . Note that if unsafe or reserved characters such as " ", "/", or "%" are present in they must be encoded as defined in RFC 1738 [RFC1738]. Newman [Page 2] Internet Draft IMAP URL Scheme October 1996 5. Lists of messages An IMAP URL referring to a list of messages has the following form: imap:////? The field is used as the argument to the IMAP4 "SELECT" command. Note that if unsafe or reserved characters such as " " or "/" are present in they must be encoded as defined in RFC 1738 [RFC1738]. The field is optional. If it is present, it must be the argument to the IMAP4 UIDVALIDITY status response at the time the URL was created. This MAY be used by the program interpreting the IMAP URL to determine if the URL is stale. The "?" field is optional. If it is not present, a list of all messages in the mailbox should be presented by the program interpreting the URL. If it is present, it should be used as all the arguments following an IMAP4 SEARCH command. Note that unsafe characters such as " " are likely to be present in the and must be encoded as defined in RFC 1738 [RFC1738]. 6. A specific message or message part An IMAP URL referring to a specific message or message part has the following form: imap://////
The is as defined above. The is mandatory for this format and is as defined above. The SHOULD be used by the program interpreting the URL to determine if the URL is stale. The refers to an IMAP4 message UID, and should be used as the argument to the IMAP4 "UID FETCH" command. The
field is optional. If not present, the URL refers to the entire RFC 822 message as returned by the IMAP command "UID FETCH RFC822". If present, the URL refers to the object returned by a "UID FETCH BODY[
]" command. The type of the object may be determined by "UID FETCH BODYSTRUCTURE" and locating the appropriate part. Note that unsafe characters in
, such as " " must be encoded as defined in RFC 1738 [RFC1738]. Newman [Page 3] Internet Draft IMAP URL Scheme October 1996 7. ABNF for IMAP URL scheme This uses ABNF as used in the IMAP specification [IMAP4]. Terminals from the BNF for URLs [RFC1738] are also used. imapurl ::= "imap://" ilogin [ imailboxlist / isearch / ipath ] ilogin ::= [ iuser [ ":" ipassword ] "@" ] hostport imailboxlist ::= "/" list_mailbox [ ";type=" list_type ] ;; unsafe characters in list_mailbox are ;; encoded as in [RFC1738] ipassword ::= *( uchar / "&" / "=" ) ipath ::= "/" mailbox "/" nz_number "/" number [ "/" section ] ;; unsafe characters in mailbox and section are ;; encoded as in [RFC1738] ;; IMAP4 literals may not be used in mailbox isearch ::= "/" mailbox "/" [nz_number] [ "?" search_program ] ;; unsafe characters in mailbox and ;; search_program, including SPACE and "/", ;; are encoded as in [RFC1738] ;; IMAP4 literals may not be used in mailbox ;; or search_program iuser ::= *( uchar / "&" / "=" ) list_type ::= "LIST" / "LSUB" ;; case insensitive search_program ::= ["CHARSET" SPACE astring SPACE] search_criteria ;; IMAP4 literals may not be used 8. References [IMAP4] Crispin, M., "Internet Message Access Protocol - Version 4", RFC 1730, University of Washington, December 1994. [RFC1738] Berners-Lee, Masinter, McCahill, "Uniform Resource Locators (URL)", RFC 1738, CERN, Xerox Coproration, University of Minnesota, December 1994. Newman [Page 4] Internet Draft IMAP URL Scheme October 1996 9. Security Considerations IMAP URLs have the same security considerations as general Internet URLs [RFC1738]. Issues discussed in the IMAP specification [IMAP4] are also relevant. No new security issues are introduced in this document. 10. Author's Address Chris Newman Innosoft 1050 East Garvey Ave. South West Covina, CA 91790 USA Email: chris.newman@innosoft.com Newman [Page 5]