@@ -43,10 +43,16 @@ module Net
43
43
# To work on the messages within a mailbox, the client must
44
44
# first select that mailbox, using either #select or #examine
45
45
# (for read-only access). Once the client has successfully
46
- # selected a mailbox, they enter the "_selected_" state, and that
46
+ # selected a mailbox, they enter the +selected+ state, and that
47
47
# mailbox becomes the _current_ mailbox, on which mail-item
48
48
# related commands implicitly operate.
49
49
#
50
+ # === Connection state
51
+ #
52
+ # Once an IMAP connection is established, the connection is in one of four
53
+ # states: <tt>not authenticated</tt>, +authenticated+, +selected+, and
54
+ # +logout+. Most commands are valid only in certain states.
55
+ #
50
56
# === Sequence numbers and UIDs
51
57
#
52
58
# Messages have two sorts of identifiers: message sequence
@@ -260,8 +266,9 @@ module Net
260
266
#
261
267
# - Net::IMAP.new: Creates a new \IMAP client which connects immediately and
262
268
# waits for a successful server greeting before the method returns.
269
+ # - #connection_state: Returns the connection state.
263
270
# - #starttls: Asks the server to upgrade a clear-text connection to use TLS.
264
- # - #logout: Tells the server to end the session. Enters the "_logout_" state.
271
+ # - #logout: Tells the server to end the session. Enters the +logout+ state.
265
272
# - #disconnect: Disconnects the connection (without sending #logout first).
266
273
# - #disconnected?: True if the connection has been closed.
267
274
#
@@ -317,37 +324,36 @@ module Net
317
324
# <em>In general, #capable? should be used rather than explicitly sending a
318
325
# +CAPABILITY+ command to the server.</em>
319
326
# - #noop: Allows the server to send unsolicited untagged #responses.
320
- # - #logout: Tells the server to end the session. Enters the "_logout_" state.
327
+ # - #logout: Tells the server to end the session. Enters the +logout+ state.
321
328
#
322
329
# ==== Not Authenticated state
323
330
#
324
331
# In addition to the commands for any state, the following commands are valid
325
- # in the "<em>not authenticated</em>" state:
332
+ # in the +not_authenticated+ state:
326
333
#
327
334
# - #starttls: Upgrades a clear-text connection to use TLS.
328
335
#
329
336
# <em>Requires the +STARTTLS+ capability.</em>
330
337
# - #authenticate: Identifies the client to the server using the given
331
338
# {SASL mechanism}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
332
- # and credentials. Enters the "_authenticated_" state.
339
+ # and credentials. Enters the +authenticated+ state.
333
340
#
334
341
# <em>The server should list <tt>"AUTH=#{mechanism}"</tt> capabilities for
335
342
# supported mechanisms.</em>
336
343
# - #login: Identifies the client to the server using a plain text password.
337
- # Using #authenticate is generally preferred. Enters the "_authenticated_"
338
- # state.
344
+ # Using #authenticate is preferred. Enters the +authenticated+ state.
339
345
#
340
346
# <em>The +LOGINDISABLED+ capability</em> <b>must NOT</b> <em>be listed.</em>
341
347
#
342
348
# ==== Authenticated state
343
349
#
344
350
# In addition to the commands for any state, the following commands are valid
345
- # in the "_authenticated_" state:
351
+ # in the +authenticated+ state:
346
352
#
347
353
# - #enable: Enables backwards incompatible server extensions.
348
354
# <em>Requires the +ENABLE+ or +IMAP4rev2+ capability.</em>
349
- # - #select: Open a mailbox and enter the "_selected_" state.
350
- # - #examine: Open a mailbox read-only, and enter the "_selected_" state.
355
+ # - #select: Open a mailbox and enter the +selected+ state.
356
+ # - #examine: Open a mailbox read-only, and enter the +selected+ state.
351
357
# - #create: Creates a new mailbox.
352
358
# - #delete: Permanently remove a mailbox.
353
359
# - #rename: Change the name of a mailbox.
@@ -369,12 +375,12 @@ module Net
369
375
#
370
376
# ==== Selected state
371
377
#
372
- # In addition to the commands for any state and the "_authenticated_"
373
- # commands, the following commands are valid in the "_selected_" state:
378
+ # In addition to the commands for any state and the +authenticated+
379
+ # commands, the following commands are valid in the +selected+ state:
374
380
#
375
- # - #close: Closes the mailbox and returns to the "_authenticated_" state,
381
+ # - #close: Closes the mailbox and returns to the +authenticated+ state,
376
382
# expunging deleted messages, unless the mailbox was opened as read-only.
377
- # - #unselect: Closes the mailbox and returns to the "_authenticated_" state,
383
+ # - #unselect: Closes the mailbox and returns to the +authenticated+ state,
378
384
# without expunging any messages.
379
385
# <em>Requires the +UNSELECT+ or +IMAP4rev2+ capability.</em>
380
386
# - #expunge: Permanently removes messages which have the Deleted flag set.
@@ -395,7 +401,7 @@ module Net
395
401
#
396
402
# ==== Logout state
397
403
#
398
- # No \IMAP commands are valid in the "_logout_" state. If the socket is still
404
+ # No \IMAP commands are valid in the +logout+ state. If the socket is still
399
405
# open, Net::IMAP will close it after receiving server confirmation.
400
406
# Exceptions will be raised by \IMAP commands that have already started and
401
407
# are waiting for a response, as well as any that are called after logout.
@@ -449,7 +455,7 @@ module Net
449
455
# ==== RFC3691: +UNSELECT+
450
456
# Folded into IMAP4rev2[https://www.rfc-editor.org/rfc/rfc9051] and also included
451
457
# above with {Core IMAP commands}[rdoc-ref:Net::IMAP@Core+IMAP+commands].
452
- # - #unselect: Closes the mailbox and returns to the "_authenticated_" state,
458
+ # - #unselect: Closes the mailbox and returns to the +authenticated+ state,
453
459
# without expunging any messages.
454
460
#
455
461
# ==== RFC4314: +ACL+
0 commit comments