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