rfc5032.IMAP_WITHIN_Search_extension.txt 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. Network Working Group E. Burger, Ed.
  2. Request for Comments: 5032 BEA Systems, Inc.
  3. Updates: 3501 September 2007
  4. Category: Standards Track
  5. WITHIN Search Extension to the IMAP Protocol
  6. Status of This Memo
  7. This document specifies an Internet standards track protocol for the
  8. Internet community, and requests discussion and suggestions for
  9. improvements. Please refer to the current edition of the "Internet
  10. Official Protocol Standards" (STD 1) for the standardization state
  11. and status of this protocol. Distribution of this memo is unlimited.
  12. Abstract
  13. This document describes the WITHIN extension to IMAP SEARCH. IMAP
  14. SEARCH returns messages whose internal date is within or outside a
  15. specified interval. The mechanism described here, OLDER and YOUNGER,
  16. differs from BEFORE and SINCE in that the client specifies an
  17. interval, rather than a date. WITHIN is useful for persistent
  18. searches where either the device does not have the capacity to
  19. perform the search at regular intervals or the network is of limited
  20. bandwidth and thus there is a desire to reduce network traffic from
  21. sending repeated requests and redundant responses.
  22. 1. Introduction
  23. This extension exposes two new search keys, OLDER and YOUNGER, each
  24. of which takes a non-zero integer argument corresponding to a time
  25. interval in seconds. The server calculates the time of interest by
  26. subtracting the time interval the client presents from the current
  27. date and time of the server. The server then either returns messages
  28. older or younger than the resultant time and date, depending on the
  29. search key used.
  30. 1.1. Conventions Used in This Document
  31. In examples, "C:" and "S:" indicate lines sent by the client and
  32. server, respectively.
  33. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  34. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  35. document are to be interpreted as described in RFC 2119 [RFC2119].
  36. Burger Standards Track [Page 1]
  37. RFC 5032 Search Within September 2007
  38. When describing the general syntax, we omit some definitions, as RFC
  39. 3501 [RFC3501] defines them.
  40. 2. Protocol Operation
  41. An IMAP4 server that supports the capability described here MUST
  42. return "WITHIN" as one of the server supported capabilities in the
  43. CAPABILITY command.
  44. For both the OLDER and YOUNGER search keys, the server calculates a
  45. target date and time by subtracting the interval, specified in
  46. seconds, from the current date and time of the server. The server
  47. then compares the target time with the INTERNALDATE of the message,
  48. as specified in IMAP [RFC3501]. For OLDER, messages match if the
  49. INTERNALDATE is less recent than or equal to the target time. For
  50. YOUNGER, messages match if the INTERNALDATE is more recent than or
  51. equal to the target time.
  52. Both OLDER and YOUNGER searches always result in exact matching, to
  53. the resolution of a second. However, if one is doing a dynamic
  54. evaluation, for example, in a context [CONTEXT], one needs to be
  55. aware that the server might perform the evaluation periodically.
  56. Thus, the server may delay the updates. Clients MUST be aware that
  57. dynamic search results may not reflect the current state of the
  58. mailbox. If the client needs a search result that reflects the
  59. current state of the mailbox, we RECOMMEND that the client issue a
  60. new search.
  61. 3. Formal Syntax
  62. The following syntax specification uses the Augmented Backus-Naur
  63. Form (ABNF) notation. Elements not defined here can be found in the
  64. formal syntax of ABNF [RFC4234] and IMAP [RFC3501].
  65. This document extends RFC 3501 [RFC3501] with two new search keys:
  66. OLDER <interval> and YOUNGER <interval>.
  67. search-key =/ ( "OLDER" / "YOUNGER" ) SP nz-number
  68. ; search-key defined in RFC 3501
  69. 4. Example
  70. C: a1 SEARCH UNSEEN YOUNGER 259200
  71. S: a1 * SEARCH 4 8 15 16 23 42
  72. Search for all unseen messages within the past 3 days, or 259200
  73. seconds, according to the server's current time.
  74. Burger Standards Track [Page 2]
  75. RFC 5032 Search Within September 2007
  76. 5. Security Considerations
  77. The WITHIN extension does not raise any security considerations that
  78. are not present in the base protocol. Considerations are the same as
  79. for IMAP [RFC3501].
  80. 6. IANA Considerations
  81. Per the IMAP RFC [RFC3501], registration of a new IMAP capability in
  82. the IMAP Capability registry requires the publication of a standards-
  83. track RFC or an IESG approved experimental RFC. The registry is
  84. currently located at
  85. <http://www.iana.org/assignments/imap4-capabilities>. This
  86. standards-track document defines the WITHIN IMAP capability. IANA
  87. has added this extension to the IANA IMAP Capability registry.
  88. 7. References
  89. 7.1. Normative References
  90. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  91. Requirement Levels", RFC 2119, BCP 14, March 1997.
  92. [RFC3501] Crispin, M., "Internet Message Access Protocol - Version
  93. 4rev1", RFC 3501, March 2003.
  94. [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
  95. Specifications: ABNF", RFC 4234, October 2005.
  96. 7.2. Informative References
  97. [CONTEXT] Melnikov, D. and C. King, "Contexts for IMAP4", Work
  98. in Progress, May 2006.
  99. Burger Standards Track [Page 3]
  100. RFC 5032 Search Within September 2007
  101. Appendix A. Contributors
  102. Stephane Maes and Ray Cromwell wrote the original version of this
  103. document as part of P-IMAP, as well as the first versions for the
  104. IETF. From an attribution perspective, they are clearly authors.
  105. Appendix B. Acknowledgements
  106. The authors want to thank all who have contributed key insight and
  107. who have extensively reviewed and discussed the concepts of LPSEARCH.
  108. They also thank the authors of its early introduction in P-IMAP.
  109. We also want to give a special thanks to Arnt Gilbrandsen, Ken
  110. Murchison, Zoltan Ordogh, and most especially Dave Cridland for their
  111. review and suggestions. A special thank you goes to Alexey Melnikov
  112. for his choice submission of text.
  113. Author's Address
  114. Eric W. Burger (editor)
  115. BEA Systems, Inc.
  116. USA
  117. EMail: eric.burger@bea.com
  118. URI: http://www.standardstrack.com
  119. Burger Standards Track [Page 4]
  120. RFC 5032 Search Within September 2007
  121. Full Copyright Statement
  122. Copyright (C) The IETF Trust (2007).
  123. This document is subject to the rights, licenses and restrictions
  124. contained in BCP 78, and except as set forth therein, the authors
  125. retain all their rights.
  126. This document and the information contained herein are provided on an
  127. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  128. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
  129. THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
  130. OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
  131. THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  132. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  133. Intellectual Property
  134. The IETF takes no position regarding the validity or scope of any
  135. Intellectual Property Rights or other rights that might be claimed to
  136. pertain to the implementation or use of the technology described in
  137. this document or the extent to which any license under such rights
  138. might or might not be available; nor does it represent that it has
  139. made any independent effort to identify any such rights. Information
  140. on the procedures with respect to rights in RFC documents can be
  141. found in BCP 78 and BCP 79.
  142. Copies of IPR disclosures made to the IETF Secretariat and any
  143. assurances of licenses to be made available, or the result of an
  144. attempt made to obtain a general license or permission for the use of
  145. such proprietary rights by implementers or users of this
  146. specification can be obtained from the IETF on-line IPR repository at
  147. http://www.ietf.org/ipr.
  148. The IETF invites any interested party to bring to its attention any
  149. copyrights, patents or patent applications, or other proprietary
  150. rights that may cover technology that may be required to implement
  151. this standard. Please address the information to the IETF at
  152. ietf-ipr@ietf.org.
  153. Burger Standards Track [Page 5]