1
2
3
4
5
6
7Network Working Group E. Burger, Ed.
8Request for Comments: 5032 BEA Systems, Inc.
9Updates: 3501 September 2007
10Category: Standards Track
11
12
13 WITHIN Search Extension to the IMAP Protocol
14
15Status of This Memo
16
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.
22
23Abstract
24
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.
34
351. Introduction
36
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
43 search key used.
44
451.1. Conventions Used in This Document
46
47 In examples, "C:" and "S:" indicate lines sent by the client and
48 server, respectively.
49
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].
53
54
55
56
57
58Burger Standards Track [Page 1]
59
60RFC 5032 Search Within September 2007
61
62
63 When describing the general syntax, we omit some definitions, as RFC
64 3501 [RFC3501] defines them.
65
662. Protocol Operation
67
68 An IMAP4 server that supports the capability described here MUST
69 return "WITHIN" as one of the server supported capabilities in the
70 CAPABILITY command.
71
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.
80
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
89 new search.
90
913. Formal Syntax
92
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].
96
97 This document extends RFC 3501 [RFC3501] with two new search keys:
98 OLDER <interval> and YOUNGER <interval>.
99
100 search-key =/ ( "OLDER" / "YOUNGER" ) SP nz-number
101 ; search-key defined in RFC 3501
102
1034. Example
104
105 C: a1 SEARCH UNSEEN YOUNGER 259200
106 S: a1 * SEARCH 4 8 15 16 23 42
107
108 Search for all unseen messages within the past 3 days, or 259200
109 seconds, according to the server's current time.
110
111
112
113
114Burger Standards Track [Page 2]
115
116RFC 5032 Search Within September 2007
117
118
1195. Security Considerations
120
121 The WITHIN extension does not raise any security considerations that
122 are not present in the base protocol. Considerations are the same as
123 for IMAP [RFC3501].
124
1256. IANA Considerations
126
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
130 currently located at
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.
134
1357. References
136
1377.1. Normative References
138
139 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
140 Requirement Levels", RFC 2119, BCP 14, March 1997.
141
142 [RFC3501] Crispin, M., "Internet Message Access Protocol - Version
143 4rev1", RFC 3501, March 2003.
144
145 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
146 Specifications: ABNF", RFC 4234, October 2005.
147
1487.2. Informative References
149
150 [CONTEXT] Melnikov, D. and C. King, "Contexts for IMAP4", Work
151 in Progress, May 2006.
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170Burger Standards Track [Page 3]
171
172RFC 5032 Search Within September 2007
173
174
175Appendix A. Contributors
176
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.
180
181Appendix B. Acknowledgements
182
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.
186
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.
191
192Author's Address
193
194 Eric W. Burger (editor)
195 BEA Systems, Inc.
196 USA
197
198 EMail: eric.burger@bea.com
199 URI: http://www.standardstrack.com
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226Burger Standards Track [Page 4]
227
228RFC 5032 Search Within September 2007
229
230
231Full Copyright Statement
232
233 Copyright (C) The IETF Trust (2007).
234
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.
238
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.
246
247Intellectual Property
248
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.
257
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.
264
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
269 ietf-ipr@ietf.org.
270
271
272
273
274
275
276
277
278
279
280
281
282Burger Standards Track [Page 5]
283
284