diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 6f85f72a..0bae6ba1 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -2227,6 +2227,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
@@ -2243,6 +2247,15 @@ def search(...)
# capability has been enabled.
#
# See #search for documentation of parameters.
+ #
+ # ===== Capabilities
+ #
+ # The search criterion is prohibited when
+ # UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
+ # 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
@@ -2303,12 +2316,15 @@ def uid_search(...)
# When QRESYNC[https://tools.ietf.org/html/rfc7162] is enabled, the
# +vanished+ fetch modifier is _not_ allowed. The +vanished+ modifier can
# only be used with #uid_fetch.
+ #
+ # When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
+ # +FETCH+ command is prohibited. Use #uid_fetch instead.
def fetch(set, attr, mod = nil, changedsince: nil)
fetch_internal("FETCH", set, attr, mod, changedsince: changedsince)
end
# :call-seq:
- # uid_fetch(set, attr, changedsince: nil) -> array of FetchData
+ # uid_fetch(set, attr, changedsince: 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.
@@ -2328,6 +2344,10 @@ def fetch(set, attr, mod = nil, changedsince: nil)
# When QRESYNC[https://tools.ietf.org/html/rfc7162] is enabled, the
# +vanished+ fetch modifier may be used. TODO: describe +vanished+.
#
+ # 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_store is updated by extensions in the same way as #store.
def uid_fetch(set, attr, mod = nil, changedsince: nil)
fetch_internal("UID FETCH", set, attr, mod, changedsince: changedsince)
@@ -2376,6 +2396,10 @@ def uid_fetch(set, attr, mod = nil, changedsince: nil)
# {[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
@@ -2393,7 +2417,11 @@ 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.
+ #
+ # 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