@@ -170,6 +170,355 @@ module Net
170170 # between UTF-8 and UTF-16), and Net::IMAP::ResponseParseError is
171171 # thrown if a server response is non-parseable.
172172 #
173+ # == What's here?
174+ #
175+ # * {Connection control}[rdoc-ref:Net::IMAP@Connection+control+methods]
176+ # * {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands]
177+ # * {...for any state}[rdoc-ref:Net::IMAP@IMAP+commands+for+any+state]
178+ # * {...for the "not authenticated" state}[rdoc-ref:Net::IMAP@IMAP+commands+for+the+-22Not+Authenticated-22+state]
179+ # * {...for the "authenticated" state}[rdoc-ref:Net::IMAP@IMAP+commands+for+the+-22Authenticated-22+state]
180+ # * {...for the "selected" state}[rdoc-ref:Net::IMAP@IMAP+commands+for+the+-22Selected-22+state]
181+ # * {...for the "logout" state}[rdoc-ref:Net::IMAP@IMAP+commands+for+the+-22Logout-22+state]
182+ # * {Supported IMAP extensions}[rdoc-ref:Net::IMAP@Supported+IMAP+extensions]
183+ # * {Handling server responses}[rdoc-ref:Net::IMAP@Handling+server+responses]
184+ #
185+ # === Connection control methods
186+ #
187+ # - Net::IMAP.new: A new client connects immediately and waits for a
188+ # successful server greeting before returning the new client object.
189+ # - #starttls: Asks the server to upgrade a clear-text connection to use TLS.
190+ # - #logout: Tells the server to end the session. Enters the "_logout_" state.
191+ # - #disconnect: Disconnects the connection (without sending #logout first).
192+ # - #disconnected?: True if the connection has been closed.
193+ #
194+ # === Core \IMAP commands
195+ #
196+ # The following commands are defined either by
197+ # the [IMAP4rev1[https://tools.ietf.org/html/rfc3501]] base specification, or
198+ # by one of the following extensions:
199+ # [IDLE[https://tools.ietf.org/html/rfc2177]],
200+ # [NAMESPACE[https://tools.ietf.org/html/rfc2342]],
201+ # [UNSELECT[https://tools.ietf.org/html/rfc3691]],
202+ #--
203+ # TODO: [ENABLE[https://tools.ietf.org/html/rfc5161]],
204+ # TODO: [LIST-EXTENDED[https://tools.ietf.org/html/rfc5258]],
205+ # TODO: [LIST-STATUS[https://tools.ietf.org/html/rfc5819]],
206+ #++
207+ # [MOVE[https://tools.ietf.org/html/rfc6851]].
208+ # These extensions are widely supported by modern IMAP4rev1 servers and have
209+ # all been integrated into [IMAP4rev2[https://tools.ietf.org/html/rfc9051]].
210+ # <em>Note: Net::IMAP doesn't fully support IMAP4rev2 yet.</em>
211+ #
212+ #--
213+ # TODO: When IMAP4rev2 is supported, add the following to the each of the
214+ # appropriate commands below.
215+ # Note:: CHECK has been removed from IMAP4rev2.
216+ # Note:: LSUB is obsoleted by +LIST-EXTENDED and has been removed from IMAP4rev2.
217+ # <em>Some arguments require the +LIST-EXTENDED+ or +IMAP4rev2+ capability.</em>
218+ # <em>Requires either the +ENABLE+ or +IMAP4rev2+ capability.</em>
219+ # <em>Requires either the +NAMESPACE+ or +IMAP4rev2+ capability.</em>
220+ # <em>Requires either the +IDLE+ or +IMAP4rev2+ capability.</em>
221+ # <em>Requires either the +UNSELECT+ or +IMAP4rev2+ capability.</em>
222+ # <em>Requires either the +UIDPLUS+ or +IMAP4rev2+ capability.</em>
223+ # <em>Requires either the +MOVE+ or +IMAP4rev2+ capability.</em>
224+ #++
225+ #
226+ # ==== \IMAP commands for any state
227+ #
228+ # - #capability: Returns the server's capabilities as an array of strings.
229+ #
230+ # <em>Capabilities may change after</em> #starttls, #authenticate, or #login
231+ # <em>and cached capabilities must be reloaded.</em>
232+ # - #noop: Allows the server to send unsolicited untagged #responses.
233+ # - #logout: Tells the server to end the session. Enters the "_logout_" state.
234+ #
235+ # ==== \IMAP commands for the "Not Authenticated" state
236+ #
237+ # In addition to the universal commands, the following commands are valid in
238+ # the "<em>not authenticated</em>" state:
239+ #
240+ # - #starttls: Upgrades a clear-text connection to use TLS.
241+ #
242+ # <em>Requires the +STARTTLS+ capability.</em>
243+ # - #authenticate: Identifies the client to the server using a {SASL
244+ # mechanism}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml].
245+ # Enters the "_authenticated_" state.
246+ #
247+ # <em>Requires the <tt>AUTH=#{mechanism}</tt> capability for the chosen
248+ # mechanism.</em>
249+ # - #login: Identifies the client to the server using a plain text password.
250+ # Using #authenticate is generally preferred. Enters the "_authenticated_"
251+ # state.
252+ #
253+ # <em>The +LOGINDISABLED+ capability</em> <b>must NOT</b> <em>be listed.</em>
254+ #
255+ # ==== \IMAP commands for the "Authenticated" state
256+ #
257+ # In addition to the universal commands, the following commands are valid in
258+ # the "_authenticated_" state:
259+ #
260+ #--
261+ # - #enable: <em>Not implemented by Net::IMAP, yet.</em>
262+ #
263+ # <em>Requires the +ENABLE+ capability.</em>
264+ #++
265+ # - #select: Open a mailbox and enter the "_selected_" state.
266+ # - #examine: Open a mailbox read-only, and enter the "_selected_" state.
267+ # - #create: Creates a new mailbox.
268+ # - #delete: Permanently remove a mailbox.
269+ # - #rename: Change the name of a mailbox.
270+ # - #subscribe: Adds a mailbox to the "subscribed" set.
271+ # - #unsubscribe: Removes a mailbox from the "subscribed" set.
272+ # - #list: Returns names and attributes of mailboxes matching a given pattern.
273+ # - #namespace: Returns mailbox namespaces, with path prefixes and delimiters.
274+ #
275+ # <em>Requires the +NAMESPACE+ capability.</em>
276+ # - #status: Returns mailbox information, e.g. message count, unseen message
277+ # count, +UIDVALIDITY+ and +UIDNEXT+.
278+ # - #append: Appends a message to the end of a mailbox.
279+ # - #idle: Allows the server to send updates to the client, without the client
280+ # needing to poll using #noop.
281+ #
282+ # <em>Requires the +IDLE+ capability.</em>
283+ # - #lsub: Lists mailboxes the user has declared "active" or "subscribed".
284+ #--
285+ # <em>Replaced by</em> <tt>LIST-EXTENDED</tt> <em>and removed from</em>
286+ # +IMAP4rev2+. <em>However, Net::IMAP hasn't implemented</em>
287+ # <tt>LIST-EXTENDED</tt> _yet_.
288+ #++
289+ #
290+ # ==== \IMAP commands for the "Selected" state
291+ #
292+ # In addition to the universal commands and the "authenticated" commands, the
293+ # following commands are valid in the "_selected_" state:
294+ #
295+ # - #close: Closes the mailbox and returns to the "_authenticated_" state,
296+ # expunging deleted messages, unless the mailbox was opened as read-only.
297+ # - #unselect: Closes the mailbox and returns to the "_authenticated_" state,
298+ # without expunging any messages.
299+ #
300+ # <em>Requires the +UNSELECT+ capability.</em>
301+ # - #expunge: Permanently removes messages which have the Deleted flag set.
302+ # - #uid_expunge: Restricts #expunge to only remove the specified UIDs.
303+ #
304+ # <em>Requires the +UIDPLUS+ capability.</em>
305+ # - #search, #uid_search: Returns sequence numbers or UIDs of messages that
306+ # match the given searching criteria.
307+ # - #fetch, #uid_fetch: Returns data associated with a set of messages,
308+ # specified by sequence number or UID.
309+ # - #store, #uid_store: Alters a message's flags.
310+ # - #copy, #uid_copy: Copies the specified messages to the end of the
311+ # specified destination mailbox.
312+ # - #move, #uid_move: Moves the specified messages to the end of the
313+ # specified destination mailbox, expunging them from the current mailbox.
314+ #
315+ # <em>Requires the +MOVE+ capability.</em>
316+ # - #check: Mostly obsolete. Can be replaced with #noop or #idle.
317+ #--
318+ # <em>Removed from IMAP4rev2.</em>
319+ #++
320+ #
321+ # ==== \IMAP commands for the "Logout" state
322+ #
323+ # No \IMAP commands are valid in the +logout+ state. If the socket is still
324+ # open, Net::IMAP will close it after receiving server confirmation.
325+ # Exceptions will be raised by \IMAP commands that have already started and
326+ # are waiting for a response, as well as any that are called after logout.
327+ #
328+ # === Supported \IMAP extensions
329+ #
330+ # ==== RFC9051: +IMAP4rev2+
331+ #
332+ # Although IMAP4rev2[https://tools.ietf.org/html/rfc9051] is <em>not supported
333+ # yet</em>, Net::IMAP supports several extensions that have been folded into
334+ # it: +IDLE+, +MOVE+, +NAMESPACE+, +UIDPLUS+, and +UNSELECT+.
335+ #--
336+ # TODO: RFC4466, ABNF extensions (automatic support for other extensions)
337+ # TODO: +ESEARCH+, ExtendedSearchData
338+ # TODO: +SEARCHRES+,
339+ # TODO: +ENABLE+,
340+ # TODO: +SASL-IR+,
341+ # TODO: +LIST-EXTENDED+,
342+ # TODO: +LIST-STATUS+,
343+ # TODO: +LITERAL-+,
344+ # TODO: +BINARY+ (only the FETCH side)
345+ # TODO: +SPECIAL-USE+
346+ # implicitly supported, but we can do better: Response codes: RFC5530, etc
347+ # implicitly supported, but we can do better: <tt>STATUS=SIZE</tt>
348+ # implicitly supported, but we can do better: <tt>STATUS DELETED</tt>
349+ #++
350+ # Commands for these extensions are included with the {Core IMAP
351+ # commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands], above. Other supported
352+ # extensons are listed below.
353+ #
354+ # ==== RFC2087: +QUOTA+
355+ # - #getquota: returns the resource usage and limits for a quota root
356+ # - #getquotaroot: returns the list of quota roots for a mailbox, as well as
357+ # their resource usage and limits.
358+ # - #setquota: sets the resource limits for a given quota root.
359+ #
360+ # ==== RFC2177: +IDLE+
361+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], so it is also
362+ # listed with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
363+ # - #idle: Allows the server to send updates to the client, without the client
364+ # needing to poll using #noop.
365+ #
366+ # ==== RFC2342: +NAMESPACE+
367+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], so it is also
368+ # listed with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
369+ # - #namespace: Returns mailbox namespaces, with path prefixes and delimiters.
370+ #
371+ # ==== RFC2971: +ID+
372+ # - #id: exchanges client and server implementation information.
373+ #
374+ #--
375+ # ==== RFC3502: +MULTIAPPEND+
376+ # TODO...
377+ #++
378+ #
379+ #--
380+ # ==== RFC3516: +BINARY+
381+ # TODO...
382+ #++
383+ #
384+ # ==== RFC3691: +UNSELECT+
385+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], so it is also
386+ # listed with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
387+ # - #unselect: Closes the mailbox and returns to the "_authenticated_" state,
388+ # without expunging any messages.
389+ #
390+ # ==== RFC4314: +ACL+
391+ # - #getacl: lists the authenticated user's access rights to a mailbox.
392+ # - #setacl: sets the access rights for a user on a mailbox
393+ #--
394+ # TODO: #deleteacl, #listrights, #myrights
395+ #++
396+ # - *_Note:_* +DELETEACL+, +LISTRIGHTS+, and +MYRIGHTS+ are not supported yet.
397+ #
398+ # ==== RFC4315: +UIDPLUS+
399+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], so it is also
400+ # listed with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
401+ # - #uid_expunge: Restricts #expunge to only remove the specified UIDs.
402+ # - Updates #select, #examine with the +UIDNOTSTICKY+ ResponseCode
403+ # - Updates #append with the +APPENDUID+ ResponseCode
404+ # - Updates #copy, #move with the +COPYUID+ ResponseCode
405+ #
406+ #--
407+ # ==== RFC4466: Collected Extensions to IMAP4 ABNF
408+ # TODO...
409+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], this RFC updates
410+ # the protocol to enable new optional parameters to many commands: #select,
411+ # #examine, #create, #rename, #fetch, #uid_fetch, #store, #uid_store, #search,
412+ # #uid_search, and #append. However, specific parameters are not defined.
413+ # Extensions to these commands use this syntax whenever possible. Net::IMAP
414+ # may be partially compatible with extensions to these commands, even without
415+ # any explicit support.
416+ #++
417+ #
418+ #--
419+ # ==== RFC4731 +ESEARCH+
420+ # TODO...
421+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051].
422+ # - Updates #search, #uid_search to accept result options: +MIN+, +MAX+,
423+ # +ALL+, +COUNT+, and to return ExtendedSearchData.
424+ #++
425+ #
426+ #--
427+ # ==== RFC4959: +SASL-IR+
428+ # TODO...
429+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051].
430+ # - Updates #authenticate to reduce round-trips for supporting mechanisms.
431+ #++
432+ #
433+ #--
434+ # ==== RFC4978: COMPRESS=DEFLATE
435+ # TODO...
436+ #++
437+ #
438+ #--
439+ # ==== RFC5182 +SEARCHRES+
440+ # TODO...
441+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051].
442+ # - Updates #search, #uid_search with the +SAVE+ result option.
443+ # - Updates #copy, #uid_copy, #fetch, #uid_fetch, #move, #uid_move, #search,
444+ # #uid_search, #store, #uid_store, and #uid_expunge with ability to
445+ # reference the saved result of a previous #search or #uid_search command.
446+ #++
447+ #
448+ # ==== RFC5256: +SORT+
449+ # - #sort, #uid_sort: An alternate version of #search or #uid_search which
450+ # sorts the results by specified keys.
451+ # ==== RFC5256: +THREAD+
452+ # - #thread, #uid_thread: An alternate version of #search or #uid_search,
453+ # which arranges the results into ordered groups or threads according to a
454+ # chosen algorithm.
455+ #
456+ #--
457+ # ==== RFC5258 +LIST-EXTENDED+
458+ # TODO...
459+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], this updates the
460+ # protocol with new optional parameters to the #list command, adding a few of
461+ # its own. Net::IMAP may be forward-compatible with future #list extensions,
462+ # even without any explicit support.
463+ # - Updates #list to accept selection options: +SUBSCRIBED+, +REMOTE+, and
464+ # +RECURSIVEMATCH+, and return options: +SUBSCRIBED+ and +CHILDREN+.
465+ #++
466+ #
467+ #--
468+ # ==== RFC5819 +LIST-STATUS+
469+ # TODO...
470+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051].
471+ # - Updates #list with +STATUS+ return option.
472+ #++
473+ #
474+ # ==== +XLIST+ (non-standard, deprecated)
475+ # - #xlist: replaced by +SPECIAL-USE+ attributes in #list responses.
476+ #
477+ #--
478+ # ==== RFC6154 +SPECIAL-USE+
479+ # TODO...
480+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051].
481+ # - Updates #list with the +SPECIAL-USE+ selection and return options.
482+ #++
483+ #
484+ # ==== RFC6851: +MOVE+
485+ # Folded into IMAP4rev2[https://tools.ietf.org/html/rfc9051], so it is also
486+ # listed with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
487+ # - #move, #uid_move: Moves the specified messages to the end of the
488+ # specified destination mailbox, expunging them from the current mailbox.
489+ #
490+ #--
491+ # ==== RFC6855: UTF8=ACCEPT
492+ # TODO...
493+ # ==== RFC6855: UTF8=ONLY
494+ # TODO...
495+ #++
496+ #
497+ #--
498+ # ==== RFC7888: <tt>LITERAL+</tt>, +LITERAL-+
499+ # TODO...
500+ # ==== RFC7162: +QRESYNC+
501+ # TODO...
502+ # ==== RFC7162: +CONDSTORE+
503+ # TODO...
504+ # ==== RFC8474: +OBJECTID+
505+ # TODO...
506+ # ==== RFC9208: +QUOTA+
507+ # TODO...
508+ #++
509+ #
510+ # === Handling server responses
511+ #
512+ # - #greeting: The server's initial untagged response, which can indicate a
513+ # pre-authenticated connection.
514+ # - #responses: The untagged responses, as a hash. Keys are the untagged
515+ # response type (e.g. "OK", "FETCH", "FLAGS") and response code (e.g.
516+ # "ALERT", "UIDVALIDITY", "UIDNEXT", "TRYCREATE", etc). Values are arrays
517+ # of UntaggedResponse or ResponseCode.
518+ # - #add_response_handler: Add a block to be called inside the receiver thread
519+ # with every server response.
520+ # - #remove_response_handler: Remove a previously added response handler.
521+ #
173522 #
174523 # == References
175524 #--
0 commit comments