diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index cb7f1b49..a5feddf6 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -735,7 +735,7 @@ module Net
# * {GSSAPI/Kerberos/SASL Service Names}[https://www.iana.org/assignments/gssapi-service-names/gssapi-service-names.xhtml]:
# +imap+
# * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
- # ===== For currently unsupported features:
+ # ==== For currently unsupported features:
# * {IMAP Quota Resource Types}[http://www.iana.org/assignments/imap4-capabilities#imap-capabilities-2]
# * {LIST-EXTENDED options and responses}[https://www.iana.org/assignments/imap-list-extended/imap-list-extended.xhtml]
# * {IMAP METADATA Server Entry and Mailbox Entry Registries}[https://www.iana.org/assignments/imap-metadata/imap-metadata.xhtml]
@@ -2377,6 +2377,10 @@ def uid_expunge(uid_set)
# result = imap.search(["SUBJECT", "hi there", "not", "new"])
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
# result.modseq # => 5594
+ #
+ # The +SEARCH+ command is prohibited when
+ # UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
+ # Use #uid_search instead.
def search(...)
search_internal("SEARCH", ...)
end
@@ -2394,6 +2398,15 @@ def search(...)
# capability has been enabled.
#
# See #search for documentation of parameters.
+ #
+ # ==== Capabilities
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
+ # search criterion is prohibited. Use +ALL+ or
+ # UID sequence-set instead.
+ #
+ # Otherwise, #uid_search is updated by extensions in the same way as
+ # #search.
def uid_search(...)
search_internal("UID SEARCH", ...)
end
@@ -2445,12 +2458,15 @@ def uid_search(...)
# {[RFC7162]}[https://tools.ietf.org/html/rfc7162] in order to use the
# +changedsince+ argument. Using +changedsince+ implicitly enables the
# +CONDSTORE+ extension.
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
+ # +FETCH+ command is prohibited. Use #uid_fetch instead.
def fetch(...)
fetch_internal("FETCH", ...)
end
# :call-seq:
- # uid_fetch(set, attr, changedsince: nil, partial: nil) -> array of FetchData
+ # uid_fetch(set, attr, changedsince: nil, partial: nil) -> array of FetchData (or UIDFetchData)
#
# Sends a {UID FETCH command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
# to retrieve data associated with a message in the mailbox.
@@ -2502,7 +2518,11 @@ def fetch(...)
# {[RFC9394]}[https://rfc-editor.org/rfc/rfc9394] in order to use the
# +partial+ argument.
#
- # Otherwise, the same as #fetch.
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
+ # enabled, #uid_fetch must be used instead of #fetch, and UIDFetchData will
+ # be returned instead of FetchData.
+ #
+ # Otherwise, #uid_fetch is updated by extensions in the same way as #fetch.
def uid_fetch(...)
fetch_internal("UID FETCH", ...)
end
@@ -2550,12 +2570,16 @@ def uid_fetch(...)
# {[RFC7162]}[https://tools.ietf.org/html/rfc7162] in order to use the
# +unchangedsince+ argument. Using +unchangedsince+ implicitly enables the
# +CONDSTORE+ extension.
+ #
+ # The +STORE+ command is prohibited when
+ # UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
+ # Use #uid_store instead.
def store(set, attr, flags, unchangedsince: nil)
store_internal("STORE", set, attr, flags, unchangedsince: unchangedsince)
end
# :call-seq:
- # uid_store(set, attr, value, unchangedsince: nil) -> array of FetchData
+ # uid_store(set, attr, value, unchangedsince: nil) -> array of FetchData (or UIDFetchData)
#
# Sends a {UID STORE command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
# to alter data associated with messages in the mailbox, in particular their
@@ -2567,7 +2591,12 @@ def store(set, attr, flags, unchangedsince: nil)
# Related: #store
#
# ==== Capabilities
- # Same as #store.
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
+ # enabled, #uid_store must be used instead of #store, and UIDFetchData will
+ # be returned instead of FetchData.
+ #
+ # Otherwise, #uid_store is updated by extensions in the same way as #store.
def uid_store(set, attr, flags, unchangedsince: nil)
store_internal("UID STORE", set, attr, flags, unchangedsince: unchangedsince)
end
@@ -2586,6 +2615,9 @@ def uid_store(set, attr, flags, unchangedsince: nil)
# with UIDPlusData. This will report the UIDVALIDITY of the destination
# mailbox, the UID set of the source messages, and the assigned UID set of
# the moved messages.
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
+ # +COPY+ command is prohibited. Use #uid_copy instead.
def copy(set, mailbox)
copy_internal("COPY", set, mailbox)
end
@@ -2598,7 +2630,10 @@ def copy(set, mailbox)
#
# ==== Capabilities
#
- # +UIDPLUS+ affects #uid_copy the same way it affects #copy.
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
+ # enabled, #uid_copy must be used instead of #copy.
+ #
+ # Otherwise, #uid_copy is updated by extensions in the same way as #copy.
def uid_copy(set, mailbox)
copy_internal("UID COPY", set, mailbox)
end
@@ -2622,6 +2657,8 @@ def uid_copy(set, mailbox)
# mailbox, the UID set of the source messages, and the assigned UID set of
# the moved messages.
#
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
+ # +MOVE+ command is prohibited. Use #uid_move instead.
def move(set, mailbox)
copy_internal("MOVE", set, mailbox)
end
@@ -2637,9 +2674,13 @@ def move(set, mailbox)
#
# ==== Capabilities
#
- # Same as #move: The server's capabilities must include +MOVE+
- # [RFC6851[https://tools.ietf.org/html/rfc6851]]. +UIDPLUS+ also affects
- # #uid_move the same way it affects #move.
+ # The server's capabilities must include either +IMAP4rev2+ or +MOVE+
+ # [RFC6851[https://tools.ietf.org/html/rfc6851]].
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
+ # enabled, #uid_move must be used instead of #move.
+ #
+ # Otherwise, #uid_move is updated by extensions in the same way as #move.
def uid_move(set, mailbox)
copy_internal("UID MOVE", set, mailbox)
end