Lemonade                                                  E. Burger, Ed.
Internet-Draft                                         BEA Systems, Inc.
Intended status: Standards Track                             R. Cromwell
Expires: August 27, 2007                                         S. Maes
                                                      Oracle Corporation
                                                       February 23, 2007


              WITHIN Search extension to the IMAP Protocol
                  draft-ietf-lemonade-search-within-04

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 August 27, 2007.

Copyright Notice

   Copyright (C) The IETF Trust (2007).












Burger, et al.           Expires August 27, 2007                [Page 1]


Internet-Draft                Search Within                February 2007


Abstract

   This document describes the WITHIN extension to IMAP SEARCH.  IMAP
   SEARCH returns messages whose internal date is within or outside a
   specified interval.  The mechanism described here, OLDER and YOUNGER,
   differs from BEFORE and SINCE in that the client specifies an
   interval, rather than a date.  We expect WITHIN to be most useful for
   persistent searches from mobile devices.











































Burger, et al.           Expires August 27, 2007                [Page 2]


Internet-Draft                Search Within                February 2007


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", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119 [1].

   When describing the general syntax, we omit some definitions as RFC
   3501 [2] defines them.








































Burger, et al.           Expires August 27, 2007                [Page 3]


Internet-Draft                Search Within                February 2007


1.  Introduction

   This extension exposes two new search keys, OLDER and YOUNGER, each
   of which takes a non-zero integer argument corresponding to a time
   interval.  The server calculates the time of interest by subtracting
   the time interval presented by the client, and either returning
   messages older or younger than the resultant time and date.












































Burger, et al.           Expires August 27, 2007                [Page 4]


Internet-Draft                Search Within                February 2007


2.  Protocol Operation

   An IMAP4 server that supports the capability described here MUST
   return "WITHIN" as one of the server supported capabilities in the
   CAPABILITY command.

   For both the OLDER and YOUNGER search keys, the server calculates a
   target date and time by subtracting the interval from the current
   date and time of the server.  The server then compares the target
   time with the INTERNALDATE of the message, as specified in IMAP [2].
   For OLDER, messages match if the INTERNALDATE is less recent than, or
   equal to, the target time.  For YOUNGER, messages match if the
   INTERNALDATE is more recent than, or equal to, the target time.

   In some cases, the server may be unable, or unwilling, to use a
   precision of a single second.  This is expected to be the case
   particularly for dynamically updated searches.  In these cases,
   servers are permitted to reduce the precision used for date
   calulcations and comparisons, but SHOULD ensure that a precision of
   no less than an hour (3600 seconds) is used.  This might mean re-
   running the search criteria only every hour for a dynamic search, for
   example.  Clients MUST be aware that search results, whether viewed
   directly or through some other mechanism, MAY not be accurate as a
   result.

   For example, if the client requests messages that are younger than
   4020 (67 minutes), but the server only performs searches with hourly
   accuracy (as mandated above), the server performs the search as if
   the client requested a 60-minute interval.  Note the choice of
   rounding up or down is at the discretion of the server.  However,
   rounding down to zero is NOT RECOMMENDED, as this may result in
   searches for messages YOUNGER than a value being rounded to YOUNGER
   0, which will always fail.


















Burger, et al.           Expires August 27, 2007                [Page 5]


Internet-Draft                Search Within                February 2007


3.  Formal Syntax

   The following syntax specification uses the Augmented Backus-Naur
   Form (ABNF) notation.  Elements not defined here can be found in the
   formal syntax of ABNF [1], IMAP [2], and IMAP Extended ABNF [3]

   This document extends RFC 3501 [2] with two new search keys: OLDER
   <interval> and YOUNGER <interval>.
   search-key /= ( "OLDER" | "YOUNGER" ) SP nz-number
                  ; search-key defined in RFC 3501









































Burger, et al.           Expires August 27, 2007                [Page 6]


Internet-Draft                Search Within                February 2007


4.  Example
   C: a1 SEARCH UNSEEN YOUNGER 259200
   S: a1 * SEARCH 4 8 15 16 23 42

   Search for all unseen messages within the past 3 days (72 hours)
   according to the server's current time.













































Burger, et al.           Expires August 27, 2007                [Page 7]


Internet-Draft                Search Within                February 2007


5.  Security Considerations

   The WITHIN extension does not raise any security considerations which
   are not present in the base protocol.  Considerations are the same as
   for IMAP [2].














































Burger, et al.           Expires August 27, 2007                [Page 8]


Internet-Draft                Search Within                February 2007


6.  IANA Considerations

   None.
















































Burger, et al.           Expires August 27, 2007                [Page 9]


Internet-Draft                Search Within                February 2007


7.  Normative References

   [1]  Bradner, S., "Key words for use in RFCs to Indicate Requirement
        Levels", RFC 2119, BCP 14, March 1997.

   [2]  Crispin, M., "Internet Message Access Protocol - Version 4rev1",
        RFC 3501, March 2003.

   [3]  Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF",
        RFC 4466, April 2006.









































Burger, et al.           Expires August 27, 2007               [Page 10]


Internet-Draft                Search Within                February 2007


Appendix A.  Acknowledgements

   The authors want to thank all who have contributed key insight and
   extensively reviewed and discussed the concepts of LPSEARCH and the
   authors of its early introduction in P-IMAP.

   We also want to give a special thanks to Arnt Gilbrandsen, Alexey
   Melnikov, Ken Murchison, Zoltan Ordogh, and most especially Dave
   Cridland for their review and suggestions.










































Burger, et al.           Expires August 27, 2007               [Page 11]


Internet-Draft                Search Within                February 2007


Authors' Addresses

   Eric W. Burger (editor)
   BEA Systems, Inc.
   USA

   Phone:
   Fax:
   Email: eric.burger@bea.com
   URI:


   Ray Cromwell
   Oracle Corporation
   500 Oracle Parkway
   Redwood Shores, CA  94065
   USA

   Email: ray.cromwell@oracle.com


   Stephane H. Maes
   Oracle Corporation
   500 Oracle Parkway, M/S 4op634
   Redwood Shores, CA  94065
   USA

   Email: stephane.maes@oracle.com























Burger, et al.           Expires August 27, 2007               [Page 12]


Internet-Draft                Search Within                February 2007


Full Copyright Statement

   Copyright (C) The IETF Trust (2007).

   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, THE IETF TRUST 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).





Burger, et al.           Expires August 27, 2007               [Page 13]