Network Working Group C. King Internet-Draft A. Melnikov Intended status: Standards Track Isode Ltd Expires: March 19, 2007 September 15, 2006 IMAP4 extension for named searches (filters) draft-melnikov-imapext-filters-00.txt 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 March 19, 2007. Copyright Notice Copyright (C) The Internet Society (2006). Abstract The document defines a way to persistently store named IMAP (RFC 3501) searches on the server. Such named searches can be subsequently referenced in a SEARCH command. King & Melnikov Expires March 19, 2007 [Page 1] Internet-Draft IMAP filters September 2006 Table of Contents 1. Conventions Used in this Document . . . . . . . . . . . . . . . 3 2. Introduction and Overview . . . . . . . . . . . . . . . . . . . 3 3. IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . . . 3 3.1. Registration of a new server entries . . . . . . . . . . . 3 3.2. FILTER SEARCH criterion . . . . . . . . . . . . . . . . . . 4 4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 6 8. Normative References . . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 7 Intellectual Property and Copyright Statements . . . . . . . . . . 8 King & Melnikov Expires March 19, 2007 [Page 2] Internet-Draft IMAP filters September 2006 1. Conventions Used in this Document In examples, "C:" and "S:" indicate lines sent by the client and server respectively. If a single "C:" or "S:" label applies to multiple lines, then the line breaks between those lines are for editorial clarity only and are not part of the actual protocol exchange. 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 [RFC2119]. [[anchor2: Editorial comments and questions are marked like this.]] 2. Introduction and Overview Persistent named searches described in this document allow clients to save favourite searches on the server. Such saved searches can save bandwidth for clients that need to regularly repeat them. The IMAP extension for persistent named searches is present in any IMAP4 implementation which advertises "X-DRAFT-I00-FILTERS" [[anchor4: Change upon publication]] as one of the supported capabilities in the CAPABILITY command response. 3. IMAP Protocol Changes 3.1. Registration of a new server entries This document reserves hierarchy of entries under the "/filters" root for storing named searches (a.k.a. "filters"). The "value" attribute of a "/filters/" server annotation is an IMAP SEARCH criteria, conforming to ABNF for the "search-criteria" non-terminal. A name of a filter is governed by ABNF for the "filter-name" non- terminal. [[anchor6: Shared versa private filters might need some discussion.]] A new filter named "" can be created (or an existing filter can be modified) by storing a non NIL value in the "value" attribute of a "/filters/" entry using the SETMETADATA [METADATA] command. A filter can be deleted by storing the NIL value in the "value" attribute of the "/filters/" entry. A filter can be renamed by first creating a filter with the new name and then deleting filter with the old one. King & Melnikov Expires March 19, 2007 [Page 3] Internet-Draft IMAP filters September 2006 C: a SETMETADATA "" "/filters/on-the-road" (value.priv "OR SMALLER 5000 FROM \"boss@example.com\"") S: a OK SETMETADATA complete 3.2. FILTER SEARCH criterion The FILTER criterion for the SEARCH command allows a client to reference a filter stored on the server by name. A filter called "" is stored in the server annotation named "/filters/ " as described in Section 3.1. Syntax: FILTER When the named filter exist, its search criteria (i.e. the associated "value" attribute) is inserted verbatum instead of the FILTER search- key. For example, the following SEARCH command C: a SEARCH UID 300:900 FILTER on-the-road SINCE " 3-Dec-2002" would be equivalent to the following C: a SEARCH UID 300:900 SMALLER 5000 FROM "boss@example.com" SINCE " 3-Dec-2002" assuming the filter "on-the-road" is as defined in example from Section 3.1. A reference to a non-existent or unaccessible (e.g. due to access control restrictions) filter MUST cause failure of the SEARCH command with the tagged NO response. [[anchor8: Do we need a new response code for reporting non-existent filters?]] Note the server SHOULD verify that each search criteria referenced by the FILTER search key is a full and correct search criteria. For example, the server should fail the SEARCH command if its SEARCH criteria references a filter containing "OR SMALLER" search criteria. Note that a named filter itself can reference another filter using the FILTER search-key. Implementations MUST be able to perform at least 3 substitution passes on the SEARCH criteria. If an implementation allows for more passes, it MUST implement some kind of loop detection. If an implementation detects a loop or still sees a FILTER search-key after performing at least 3 substitutions, it MUST behave as if the specified filter doesn't exist (as described above). King & Melnikov Expires March 19, 2007 [Page 4] Internet-Draft IMAP filters September 2006 4. 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 [RFC3501] or [IMAPABNF]. 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. capability =/ "X-DRAFT-I00-FILTERS" ;; [[Note to RFC Editor: change the capability name before ;; publication]] search-criteria = search-key *(SP search-key) search-key =/ "FILTER" SP filter-name ;; New SEARCH criterion for referencing filters filter-name = 1* [[anchor10: Should filter-name be in UTF-8?]] 5. Security Considerations General issues relevant to [RFC3501] (in particular to the SEARCH command) and [METADATA] are also relevant to this document. Note that excessive use of filters can potentially simplify DoS attacks, especially if combined with poor implementations and lack of loop detection. Servers that allow for anonymous access SHOULD NOT allow anonymous users to create/edit/delete filters. Also note that stored filters can potentially dislose personal information about users. When confidentiality of such information is important, clients should use TLS and/or SASL security layer (or similar) as recommended in [RFC3501]. As always, it is important to thoroughly test clients and servers implementing this extension. King & Melnikov Expires March 19, 2007 [Page 5] Internet-Draft IMAP filters 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-FILTERS [[anchor13: Note to RFC Editor: fix before publication]] IMAP capability. IANA is requested to add it to the registry. IANA is also requested to add the following entry to the [METADATA] registry. To: iana@iana.org Subject: IMAP METADATA Registration Please register the following IMAP METADATA item: [x] Entry [ ] Attribute [ ] Mailbox [x] Server Name: /filters/ Description: Defined in RFC XXXX. Content-type: text/plain; charset=utf-8 Contact person: Alexey Melnikov Email: alexey.melnikov@isode.com 7. Acknowledgments Thanks to David Cridland for comments and suggestions on this document. 8. Normative References [ABNF] Crocker, D., Ed. and P. Overell, Ed., "Augmented BNF for Syntax Specifications: ABNF", RFC 4234, October 2005. [IMAPABNF] King & Melnikov Expires March 19, 2007 [Page 6] Internet-Draft IMAP filters September 2006 Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF", RFC 4466, April 2006. [METADATA] Daboo, C., "IMAP ANNOTATEMORE Extension", draft-daboo-imap-annotatemore-09 (work in progress), March 2006. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003. Authors' Addresses Curtis King Isode Ltd 5 Castle Business Village 36 Station Road Hampton, Middlesex TW12 2BX UK Email: Curtis.King@mumbo.ca Alexey Melnikov Isode Ltd 5 Castle Business Village 36 Station Road Hampton, Middlesex TW12 2BX UK Email: Alexey.Melnikov@isode.com King & Melnikov Expires March 19, 2007 [Page 7] Internet-Draft IMAP filters 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). King & Melnikov Expires March 19, 2007 [Page 8]