IMAP Extensions Working Group B. Leiba Internet-Draft IBM T.J. Watson Research Center Obsoletes: 3348 (if approved) A. Melnikov Updates: 2193 (if approved) Isode Limited Intended status: Standards Track September 29, 2006 Expires: April 2, 2007 IMAP4 Multimailbox SEARCH Extension draft-melnikov-imapext-multimailbox-search-01 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. 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 and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate 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. This Internet-Draft will expire on April 2, 2007. Copyright Notice Copyright (C) The Internet Society (2006). Leiba & Melnikov Expires April 2, 2007 [Page 1] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 Abstract The IMAP4 specification allows the searching only of the selected mailbox. A user often wants to search multiple mailboxes, and a client that wishes to support this must issue a series of SELECT and SEARCH commands, waiting for each to complete before moving on to the next. This extension allows a client to search multiple mailboxes with one command, limiting the round-trips and waiting for various searches to complete. This also introduces mailbox field in ESEARCH responses, allowing a client to pipeline the searches if it chooses. Leiba & Melnikov Expires April 2, 2007 [Page 2] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 Note 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, and should be sent to ietf-imapext@imc.org. Table of Contents 1. Conventions used in this document . . . . . . . . . . . . . . 4 2. Extended SEARCH/UID SEARCH command . . . . . . . . . . . . . . 5 3. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 8 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 12 8. Normative References . . . . . . . . . . . . . . . . . . . . . 13 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 14 Intellectual Property and Copyright Statements . . . . . . . . 15 Leiba & Melnikov Expires April 2, 2007 [Page 3] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 1. Conventions used in this document In examples, "C:" indicates lines sent by a client that is connected to a server. "S:" indicates lines sent by the server to the client. The words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" are used in this document as specified in RFC 2119 [Kwds]. Leiba & Melnikov Expires April 2, 2007 [Page 4] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 2. Extended SEARCH/UID SEARCH command Arguments: OPTIONAL source options OPTIONAL result options OPTIONAL [CHARSET] specification searching criteria (one or more) Responses: REQUIRED untagged response: SEARCH or ESEARCH Result: OK - search completed NO - search error: cannot search that [CHARSET] or criteria BAD - command unknown or arguments invalid This section further updates definition of the SEARCH command described in section 2.6.1 of [IMAPABNF] (initially described in section 6.4.4 of [RFC3501]. The SEARCH command is extended to allow for optional source and result options. [[anchor3: What about ALL referenced below?]] This document does not define any result options. Unless specified otherwise by a description of a result option, presence of a search source option REQUIREs that the server returns ESEARCH responses instead of the corresponding SEARCH responses. Also, an extended UID SEARCH command MUST cause a ESEARCH response with the UID indicator present. Presence of a source option in absence of a result option implies "ALL" result option (see [ESEARCH]). [[anchor4: SEARCH with source options is allowed in authenticated state (and not just "selected")!!!]] [[anchor5: ACL (add ref) 'r' right is required for each mailbox.]] Source options describe which mailboxes must be searched for messages. (Without the source options only the current mailbox is searched.) Note that a SEARCH/UID SEARCH command with source options doesn't affect which mailbox is currently selected and doesn't require any mailbox to be selected. For each mailbox satisfying the source options, a single ESEARCH response MUST be returned. The ESEARCH response MUST contain the MAILBOX correlator in addition to the TAG correlator. Correlators allow clients to issue several SEARCH/UID SEARCH commands at once (pipelined). The server MAY perform those searches in parallel; it MAY instead serialize them. The source options, if present, MUST contain one or more mailbox list Leiba & Melnikov Expires April 2, 2007 [Page 5] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 pattern, any one of them can contain the IMAP mailbox wildcard characters. The patterns can be optionally followed by other search source options. Only one such option is defined by this document: "DEPTH". The option "depth " causes the SEARCH command to traverse the hierarchy "n" levels down (including the current level). Thus, mailbox pattern "xyz*" with "depth 2" and mailbox pattern "xyz/*" with "depth 1" will both match child mailboxes of "xyz", but will not match child mailboxes of those children (of course, the former will also match "xyzabc", while the latter will not). Leiba & Melnikov Expires April 2, 2007 [Page 6] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 3. Example [[anchor7: Clarify that returning message numbers for not currently opened mailbox is *silly*!]] C: tag1 SEARCH IN (("folder1" "folder2/*") (depth 1)) unseen C: tag2 SEARCH IN (("folder1" "folder2/*")) subject "chad" S: * ESEARCH (TAG "tag1" mailbox "folder1") ALL 1,3,5,7,9 S: * ESEARCH (TAG "tag1" mailbox "folder1") ALL 1:4,8 S: * ESEARCH (TAG "tag1" mailbox "folder2/banana") ALL 2,4 S: * ESEARCH (TAG "tag1" mailbox "folder2/peach") ALL 691 S: tag1 OK done S: * ESEARCH (TAG "tag2" mailbox "folder2/dubya") ALL 3,6,9,12 S: tag2 OK done Leiba & Melnikov Expires April 2, 2007 [Page 7] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 4. Formal Syntax The following syntax specification uses the augmented Backus-Naur Form (BNF) as described in [ABNF]. Terms not defined here are taken from [RFC3501], [LISTEXT] or [IMAPABNF]. [[anchor8: Updates definition in RFC 4466 (added "[search-opts]"):]] search = "SEARCH" [search-source-opts] [search-return-opts] SP search-program [[anchor9: Defined in RFC 4466 (updated to reference search-criteria):]] search-program = ["CHARSET" SP charset SP] search-criteria ;; CHARSET argument to SEARCH MUST be ;; registered with IANA. search-source-opts = SP "IN" SP "(" patterns [SP "(" scope-options ")"] ")" scope-option = "DEPTH" SP number / scope-option-ext scope-options = scope-option *(SP scope-option) ;; a given option may only appear once scope-option-name = tagged-ext-label scope-option-ext = scope-option-name [SP scope-option-value] scope-option-value= tagged-ext-val ;; This non-terminal shows recommended syntax ;; for future extensions. Leiba & Melnikov Expires April 2, 2007 [Page 8] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 [[anchor10: Also defined in FILTERS:]] search-criteria = search-key *(SP search-key) [[anchor11: Redefining search-correlator from RFC 4466:]] search-correlator = SP "(" single-correlator *(SP single-correlator) ")" [[anchor12: This is a new non-terminal:]] single-correlator = "TAG" SP tag-string / "MAILBOX" SP astring [[anchor13: The following 2 are borrowed from LISTEXT:]] [[anchor14: Is this one used?]] mbox-or-pat = list-mailbox / patterns patterns = "(" list-mailbox *(SP list-mailbox) ")" Leiba & Melnikov Expires April 2, 2007 [Page 9] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 5. Security Considerations [[anchor15: TBD]] Leiba & Melnikov Expires April 2, 2007 [Page 10] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 6. IANA Considerations IMAP4 capabilities are registered by publishing a standards track or IESG approved experimental RFC. The registry is currently located at: http://www.iana.org/assignments/imap4-capabilities This document defines the X-DRAFT-I00-MMBX [[anchor16: Note to RFC Editor: fix before publication]] IMAP capability. IANA is requested to add it to the registry. Leiba & Melnikov Expires April 2, 2007 [Page 11] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 7. Acknowledgements [[anchor18: TBD]] Leiba & Melnikov Expires April 2, 2007 [Page 12] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 8. Normative References [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 4234, October 2005. [CHARSET] Freed, N. and J. Postel, "IANA Charset Registration Procedures", RFC 2978, October 2000. [ESEARCH] Melnikov, A. and D. Cridland, "IMAP4 extension to SEARCH command for controlling what kind of information is returned", draft-melnikov-imap-search-ret-03 (work in progress), June 2006. [IMAPABNF] Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF", RFC 4466, April 2006. [Kwds] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, March 1997. [LISTEXT] Leiba, B. and A. Melnikov, "IMAP4 LIST Command Extensions", draft-ietf-imapext-list-extensions-17 (work in progress), 2006. [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003. Leiba & Melnikov Expires April 2, 2007 [Page 13] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 Authors' Addresses Barry Leiba IBM T.J. Watson Research Center 19 Skyline Drive Hawthorne, NY 10532 US Phone: +1 914 784 7941 Email: leiba@watson.ibm.com Alexey Melnikov Isode Limited 5 Castle Business Village 36 Station Road Hampton, Middlesex TW12 2BX UK Email: Alexey.Melnikov@isode.com URI: http://www.melnikov.ca/ Leiba & Melnikov Expires April 2, 2007 [Page 14] Internet-Draft IMAP4 Multimailbox SEARCH Extension September 2006 Full Copyright Statement Copyright (C) The Internet Society (2006). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Intellectual Property The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Acknowledgment Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). Leiba & Melnikov Expires April 2, 2007 [Page 15]