rev |
line source |
yuuji@0
|
1
|
yuuji@0
|
2
|
yuuji@0
|
3
|
yuuji@0
|
4
|
yuuji@0
|
5
|
yuuji@0
|
6
|
yuuji@0
|
7 Network Working Group B. Leiba
|
yuuji@0
|
8 Request for Comments: 2177 IBM T.J. Watson Research Center
|
yuuji@0
|
9 Category: Standards Track June 1997
|
yuuji@0
|
10
|
yuuji@0
|
11
|
yuuji@0
|
12 IMAP4 IDLE command
|
yuuji@0
|
13
|
yuuji@0
|
14 Status of this Memo
|
yuuji@0
|
15
|
yuuji@0
|
16 This document specifies an Internet standards track protocol for the
|
yuuji@0
|
17 Internet community, and requests discussion and suggestions for
|
yuuji@0
|
18 improvements. Please refer to the current edition of the "Internet
|
yuuji@0
|
19 Official Protocol Standards" (STD 1) for the standardization state
|
yuuji@0
|
20 and status of this protocol. Distribution of this memo is unlimited.
|
yuuji@0
|
21
|
yuuji@0
|
22 1. Abstract
|
yuuji@0
|
23
|
yuuji@0
|
24 The Internet Message Access Protocol [IMAP4] requires a client to
|
yuuji@0
|
25 poll the server for changes to the selected mailbox (new mail,
|
yuuji@0
|
26 deletions). It's often more desirable to have the server transmit
|
yuuji@0
|
27 updates to the client in real time. This allows a user to see new
|
yuuji@0
|
28 mail immediately. It also helps some real-time applications based on
|
yuuji@0
|
29 IMAP, which might otherwise need to poll extremely often (such as
|
yuuji@0
|
30 every few seconds). (While the spec actually does allow a server to
|
yuuji@0
|
31 push EXISTS responses aysynchronously, a client can't expect this
|
yuuji@0
|
32 behaviour and must poll.)
|
yuuji@0
|
33
|
yuuji@0
|
34 This document specifies the syntax of an IDLE command, which will
|
yuuji@0
|
35 allow a client to tell the server that it's ready to accept such
|
yuuji@0
|
36 real-time updates.
|
yuuji@0
|
37
|
yuuji@0
|
38 2. Conventions Used in this Document
|
yuuji@0
|
39
|
yuuji@0
|
40 In examples, "C:" and "S:" indicate lines sent by the client and
|
yuuji@0
|
41 server respectively.
|
yuuji@0
|
42
|
yuuji@0
|
43 The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY"
|
yuuji@0
|
44 in this document are to be interpreted as described in RFC 2060
|
yuuji@0
|
45 [IMAP4].
|
yuuji@0
|
46
|
yuuji@0
|
47 3. Specification
|
yuuji@0
|
48
|
yuuji@0
|
49 IDLE Command
|
yuuji@0
|
50
|
yuuji@0
|
51 Arguments: none
|
yuuji@0
|
52
|
yuuji@0
|
53 Responses: continuation data will be requested; the client sends
|
yuuji@0
|
54 the continuation data "DONE" to end the command
|
yuuji@0
|
55
|
yuuji@0
|
56
|
yuuji@0
|
57
|
yuuji@0
|
58 Leiba Standards Track [Page 1]
|
yuuji@0
|
59
|
yuuji@0
|
60 RFC 2177 IMAP4 IDLE command June 1997
|
yuuji@0
|
61
|
yuuji@0
|
62
|
yuuji@0
|
63
|
yuuji@0
|
64 Result: OK - IDLE completed after client sent "DONE"
|
yuuji@0
|
65 NO - failure: the server will not allow the IDLE
|
yuuji@0
|
66 command at this time
|
yuuji@0
|
67 BAD - command unknown or arguments invalid
|
yuuji@0
|
68
|
yuuji@0
|
69 The IDLE command may be used with any IMAP4 server implementation
|
yuuji@0
|
70 that returns "IDLE" as one of the supported capabilities to the
|
yuuji@0
|
71 CAPABILITY command. If the server does not advertise the IDLE
|
yuuji@0
|
72 capability, the client MUST NOT use the IDLE command and must poll
|
yuuji@0
|
73 for mailbox updates. In particular, the client MUST continue to be
|
yuuji@0
|
74 able to accept unsolicited untagged responses to ANY command, as
|
yuuji@0
|
75 specified in the base IMAP specification.
|
yuuji@0
|
76
|
yuuji@0
|
77 The IDLE command is sent from the client to the server when the
|
yuuji@0
|
78 client is ready to accept unsolicited mailbox update messages. The
|
yuuji@0
|
79 server requests a response to the IDLE command using the continuation
|
yuuji@0
|
80 ("+") response. The IDLE command remains active until the client
|
yuuji@0
|
81 responds to the continuation, and as long as an IDLE command is
|
yuuji@0
|
82 active, the server is now free to send untagged EXISTS, EXPUNGE, and
|
yuuji@0
|
83 other messages at any time.
|
yuuji@0
|
84
|
yuuji@0
|
85 The IDLE command is terminated by the receipt of a "DONE"
|
yuuji@0
|
86 continuation from the client; such response satisfies the server's
|
yuuji@0
|
87 continuation request. At that point, the server MAY send any
|
yuuji@0
|
88 remaining queued untagged responses and then MUST immediately send
|
yuuji@0
|
89 the tagged response to the IDLE command and prepare to process other
|
yuuji@0
|
90 commands. As in the base specification, the processing of any new
|
yuuji@0
|
91 command may cause the sending of unsolicited untagged responses,
|
yuuji@0
|
92 subject to the ambiguity limitations. The client MUST NOT send a
|
yuuji@0
|
93 command while the server is waiting for the DONE, since the server
|
yuuji@0
|
94 will not be able to distinguish a command from a continuation.
|
yuuji@0
|
95
|
yuuji@0
|
96 The server MAY consider a client inactive if it has an IDLE command
|
yuuji@0
|
97 running, and if such a server has an inactivity timeout it MAY log
|
yuuji@0
|
98 the client off implicitly at the end of its timeout period. Because
|
yuuji@0
|
99 of that, clients using IDLE are advised to terminate the IDLE and
|
yuuji@0
|
100 re-issue it at least every 29 minutes to avoid being logged off.
|
yuuji@0
|
101 This still allows a client to receive immediate mailbox updates even
|
yuuji@0
|
102 though it need only "poll" at half hour intervals.
|
yuuji@0
|
103
|
yuuji@0
|
104
|
yuuji@0
|
105
|
yuuji@0
|
106
|
yuuji@0
|
107
|
yuuji@0
|
108
|
yuuji@0
|
109
|
yuuji@0
|
110
|
yuuji@0
|
111
|
yuuji@0
|
112
|
yuuji@0
|
113
|
yuuji@0
|
114 Leiba Standards Track [Page 2]
|
yuuji@0
|
115
|
yuuji@0
|
116 RFC 2177 IMAP4 IDLE command June 1997
|
yuuji@0
|
117
|
yuuji@0
|
118
|
yuuji@0
|
119 Example: C: A001 SELECT INBOX
|
yuuji@0
|
120 S: * FLAGS (Deleted Seen)
|
yuuji@0
|
121 S: * 3 EXISTS
|
yuuji@0
|
122 S: * 0 RECENT
|
yuuji@0
|
123 S: * OK [UIDVALIDITY 1]
|
yuuji@0
|
124 S: A001 OK SELECT completed
|
yuuji@0
|
125 C: A002 IDLE
|
yuuji@0
|
126 S: + idling
|
yuuji@0
|
127 ...time passes; new mail arrives...
|
yuuji@0
|
128 S: * 4 EXISTS
|
yuuji@0
|
129 C: DONE
|
yuuji@0
|
130 S: A002 OK IDLE terminated
|
yuuji@0
|
131 ...another client expunges message 2 now...
|
yuuji@0
|
132 C: A003 FETCH 4 ALL
|
yuuji@0
|
133 S: * 4 FETCH (...)
|
yuuji@0
|
134 S: A003 OK FETCH completed
|
yuuji@0
|
135 C: A004 IDLE
|
yuuji@0
|
136 S: * 2 EXPUNGE
|
yuuji@0
|
137 S: * 3 EXISTS
|
yuuji@0
|
138 S: + idling
|
yuuji@0
|
139 ...time passes; another client expunges message 3...
|
yuuji@0
|
140 S: * 3 EXPUNGE
|
yuuji@0
|
141 S: * 2 EXISTS
|
yuuji@0
|
142 ...time passes; new mail arrives...
|
yuuji@0
|
143 S: * 3 EXISTS
|
yuuji@0
|
144 C: DONE
|
yuuji@0
|
145 S: A004 OK IDLE terminated
|
yuuji@0
|
146 C: A005 FETCH 3 ALL
|
yuuji@0
|
147 S: * 3 FETCH (...)
|
yuuji@0
|
148 S: A005 OK FETCH completed
|
yuuji@0
|
149 C: A006 IDLE
|
yuuji@0
|
150
|
yuuji@0
|
151 4. Formal Syntax
|
yuuji@0
|
152
|
yuuji@0
|
153 The following syntax specification uses the augmented Backus-Naur
|
yuuji@0
|
154 Form (BNF) notation as specified in [RFC-822] as modified by [IMAP4].
|
yuuji@0
|
155 Non-terminals referenced but not defined below are as defined by
|
yuuji@0
|
156 [IMAP4].
|
yuuji@0
|
157
|
yuuji@0
|
158 command_auth ::= append / create / delete / examine / list / lsub /
|
yuuji@0
|
159 rename / select / status / subscribe / unsubscribe
|
yuuji@0
|
160 / idle
|
yuuji@0
|
161 ;; Valid only in Authenticated or Selected state
|
yuuji@0
|
162
|
yuuji@0
|
163 idle ::= "IDLE" CRLF "DONE"
|
yuuji@0
|
164
|
yuuji@0
|
165
|
yuuji@0
|
166
|
yuuji@0
|
167
|
yuuji@0
|
168
|
yuuji@0
|
169
|
yuuji@0
|
170 Leiba Standards Track [Page 3]
|
yuuji@0
|
171
|
yuuji@0
|
172 RFC 2177 IMAP4 IDLE command June 1997
|
yuuji@0
|
173
|
yuuji@0
|
174
|
yuuji@0
|
175 5. References
|
yuuji@0
|
176
|
yuuji@0
|
177 [IMAP4] Crispin, M., "Internet Message Access Protocol - Version
|
yuuji@0
|
178 4rev1", RFC 2060, December 1996.
|
yuuji@0
|
179
|
yuuji@0
|
180 6. Security Considerations
|
yuuji@0
|
181
|
yuuji@0
|
182 There are no known security issues with this extension.
|
yuuji@0
|
183
|
yuuji@0
|
184 7. Author's Address
|
yuuji@0
|
185
|
yuuji@0
|
186 Barry Leiba
|
yuuji@0
|
187 IBM T.J. Watson Research Center
|
yuuji@0
|
188 30 Saw Mill River Road
|
yuuji@0
|
189 Hawthorne, NY 10532
|
yuuji@0
|
190
|
yuuji@0
|
191 Email: leiba@watson.ibm.com
|
yuuji@0
|
192
|
yuuji@0
|
193
|
yuuji@0
|
194
|
yuuji@0
|
195
|
yuuji@0
|
196
|
yuuji@0
|
197
|
yuuji@0
|
198
|
yuuji@0
|
199
|
yuuji@0
|
200
|
yuuji@0
|
201
|
yuuji@0
|
202
|
yuuji@0
|
203
|
yuuji@0
|
204
|
yuuji@0
|
205
|
yuuji@0
|
206
|
yuuji@0
|
207
|
yuuji@0
|
208
|
yuuji@0
|
209
|
yuuji@0
|
210
|
yuuji@0
|
211
|
yuuji@0
|
212
|
yuuji@0
|
213
|
yuuji@0
|
214
|
yuuji@0
|
215
|
yuuji@0
|
216
|
yuuji@0
|
217
|
yuuji@0
|
218
|
yuuji@0
|
219
|
yuuji@0
|
220
|
yuuji@0
|
221
|
yuuji@0
|
222
|
yuuji@0
|
223
|
yuuji@0
|
224
|
yuuji@0
|
225
|
yuuji@0
|
226 Leiba Standards Track [Page 4]
|
yuuji@0
|
227
|