Skip to content

Commit 8bb86c2

Browse files
committed
📚 List all currently supported response codes
Also adds section headers and links to RFCs and Net::IMAP methods.
1 parent db46339 commit 8bb86c2

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

lib/net/imap/response_data.rb

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ class ResponseText < Struct.new(:code, :text)
205205
# defines them. When unknown response code data is encountered, #data
206206
# will return an unparsed string.
207207
#
208+
# ==== +IMAP4rev1+ Response Codes
208209
# See [IMAP4rev1[https://www.rfc-editor.org/rfc/rfc3501]] {§7.1, "Server
209210
# Responses - Status
210211
# Responses"}[https://www.rfc-editor.org/rfc/rfc3501#section-7.1] for full
@@ -228,13 +229,32 @@ class ResponseText < Struct.new(:code, :text)
228229
# {§2.3.1.1, "Unique Identifier (UID) Message
229230
# Attribute}[https://www.rfc-editor.org/rfc/rfc3501#section-2.3.1.1].
230231
# * +UIDVALIDITY+, #data is an Integer, the UID validity value of the
231-
# mailbox See [{IMAP4rev1}[https://www.rfc-editor.org/rfc/rfc3501]],
232+
# mailbox. See [{IMAP4rev1}[https://www.rfc-editor.org/rfc/rfc3501]],
232233
# {§2.3.1.1, "Unique Identifier (UID) Message
233234
# Attribute}[https://www.rfc-editor.org/rfc/rfc3501#section-2.3.1.1].
234235
# * +UNSEEN+, #data is an Integer, the number of messages which do not have
235236
# the <tt>\Seen</tt> flag set.
236-
#
237-
# See RFC5530[https://www.rfc-editor.org/rfc/rfc5530], "IMAP Response
237+
# <em>DEPRECATED by IMAP4rev2.</em>
238+
#
239+
# ==== +BINARY+ extension
240+
# See {[RFC3516]}[https://www.rfc-editor.org/rfc/rfc3516].
241+
# * +UNKNOWN-CTE+, with a tagged +NO+ response, when the server does not
242+
# known how to decode a CTE (content-transfer-encoding). #data is +nil+.
243+
# See IMAP#fetch.
244+
#
245+
# ==== +UIDPLUS+ extension
246+
# See {[RFC4315 §3]}[https://www.rfc-editor.org/rfc/rfc4315#section-3].
247+
# * +APPENDUID+, #data is UIDPlusData. See IMAP#append.
248+
# * +COPYUID+, #data is UIDPlusData. See IMAP#copy.
249+
# * +UIDNOTSTICKY+, #data is +nil+. See IMAP#select.
250+
#
251+
# ==== +SEARCHRES+ extension
252+
# See {[RFC5182]}[https://www.rfc-editor.org/rfc/rfc5182].
253+
# * +NOTSAVED+, with a tagged +NO+ response, when the search result variable
254+
# is not saved. #data is +nil+.
255+
#
256+
# ==== +RFC5530+ Response Codes
257+
# See {[RFC5530]}[https://www.rfc-editor.org/rfc/rfc5530], "IMAP Response
238258
# Codes" for the definition of the following response codes, which are all
239259
# machine-readable annotations for the human-readable ResponseText#text, and
240260
# have +nil+ #data of their own:
@@ -256,9 +276,24 @@ class ResponseText < Struct.new(:code, :text)
256276
# * +ALREADYEXISTS+
257277
# * +NONEXISTENT+
258278
#
259-
# Other supported \IMAP extension response codes:
260-
# * +OBJECTID+ {[RFC8474]}[https://www.rfc-editor.org/rfc/rfc8474.html#section-7]
261-
# * +MAILBOXID+, #data will be a string
279+
# ==== +QRESYNC+ extension
280+
# See {[RFC7162]}[https://www.rfc-editor.org/rfc/rfc7162.html].
281+
# * +CLOSED+, returned when the currently selected mailbox is closed
282+
# implicity by selecting or examining another mailbox. #data is +nil+.
283+
#
284+
# ==== +IMAP4rev2+ Response Codes
285+
# See {[RFC9051]}[https://www.rfc-editor.org/rfc/rfc9051] {§7.1, "Server
286+
# Responses - Status
287+
# Responses"}[https://www.rfc-editor.org/rfc/rfc9051#section-7.1] for full
288+
# descriptions of IMAP4rev2 response codes. IMAP4rev2 includes all of the
289+
# response codes listed above (except "UNSEEN") and adds the following:
290+
# * +HASCHILDREN+, with a tagged +NO+ response, when a mailbox delete failed
291+
# because the server doesn't allow deletion of mailboxes with children.
292+
# #data is +nil+.
293+
#
294+
# ==== +OBJECTID+ extension
295+
# See {[RFC8474]}[https://www.rfc-editor.org/rfc/rfc8474.html].
296+
# * +MAILBOXID+, #data is a string
262297
#
263298
class ResponseCode < Struct.new(:name, :data)
264299
##

0 commit comments

Comments
 (0)