@@ -462,6 +462,9 @@ module Net
462462 # +LITERAL-+, and +SPECIAL-USE+.</em>
463463 #
464464 # ==== RFC2087: +QUOTA+
465+ # +NOTE:+ Only the +STORAGE+ quota resource type is currently supported.
466+ # - Obsoleted by <tt>QUOTA=RES-*</tt> [RFC9208[https://www.rfc-editor.org/rfc/rfc9208]],
467+ # although the commands are backward compatible.
465468 # - #getquota: returns the resource usage and limits for a quota root
466469 # - #getquotaroot: returns the list of quota roots for a mailbox, as well as
467470 # their resource usage and limits.
@@ -576,6 +579,16 @@ module Net
576579 # See FetchData#emailid and FetchData#emailid.
577580 # - Updates #status with support for the +MAILBOXID+ status attribute.
578581 #
582+ # ==== RFC9208: <tt>QUOTA=RES-*</tt>
583+ # +NOTE:+ Only the +STORAGE+ quota resource type is currently supported.
584+ # - Obsoletes the +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
585+ # extension and provides strict semantics for different resource types.
586+ # - #getquota: returns the resource usage and limits for a quota root
587+ # - #getquotaroot: returns the list of quota roots for a mailbox, as well as
588+ # their resource usage and limits.
589+ # - #setquota: sets the resource limits for a given quota root.
590+ # - Updates #status with <tt>"DELETED"</tt> and +DELETED-STORAGE+ attributes.
591+ #
579592 # ==== RFC9394: +PARTIAL+
580593 # - Updates #search, #uid_search with the +PARTIAL+ return option which adds
581594 # ESearchResult#partial return data.
@@ -696,13 +709,12 @@ module Net
696709 #
697710 # === \IMAP Extensions
698711 #
699- # [QUOTA[https://www.rfc-editor.org/rfc/rfc9208 ]]::
700- # Melnikov, A ., "IMAP QUOTA Extension ", RFC 9208 , DOI 10.17487/RFC9208 ,
701- # March 2022 , <https://www.rfc-editor.org/info/rfc9208 >.
712+ # [QUOTA[https://www.rfc-editor.org/rfc/rfc2087 ]]::
713+ # Myers, J ., "IMAP4 QUOTA extension ", RFC 2087 , DOI 10.17487/RFC2087 ,
714+ # January 1997 , <https://www.rfc-editor.org/info/rfc2087 >.
702715 #
703- # <em>Note: obsoletes</em>
704- # RFC-2087[https://www.rfc-editor.org/rfc/rfc2087]<em> (January 1997)</em>.
705- # <em>Net::IMAP does not fully support the RFC9208 updates yet.</em>
716+ # *NOTE*: _obsoleted_ by RFC9208[https://www.rfc-editor.org/rfc/rfc9208]
717+ # (March 2022).
706718 # [IDLE[https://www.rfc-editor.org/rfc/rfc2177]]::
707719 # Leiba, B., "IMAP4 IDLE command", RFC 2177, DOI 10.17487/RFC2177,
708720 # June 1997, <https://www.rfc-editor.org/info/rfc2177>.
@@ -754,6 +766,11 @@ module Net
754766 # Gondwana, B., Ed., "IMAP Extension for Object Identifiers",
755767 # RFC 8474, DOI 10.17487/RFC8474, September 2018,
756768 # <https://www.rfc-editor.org/info/rfc8474>.
769+ # [{QUOTA=RES-*}[https://www.rfc-editor.org/rfc/rfc9208]]::
770+ # Melnikov, A., "IMAP QUOTA Extension", RFC 9208, DOI 10.17487/RFC9208,
771+ # March 2022, <https://www.rfc-editor.org/info/rfc9208>.
772+ #
773+ # Obsoletes RFC2087[https://www.rfc-editor.org/rfc/rfc2087].
757774 # [PARTIAL[https://www.rfc-editor.org/info/rfc9394]]::
758775 # Melnikov, A., Achuthan, A., Nagulakonda, V., and L. Alves,
759776 # "IMAP PARTIAL Extension for Paged SEARCH and FETCH", RFC 9394,
@@ -767,6 +784,7 @@ module Net
767784 #
768785 # === IANA registries
769786 # * {IMAP Capabilities}[http://www.iana.org/assignments/imap4-capabilities]
787+ # * {IMAP Quota Resource Types}[http://www.iana.org/assignments/imap4-capabilities#imap-capabilities-2]
770788 # * {IMAP Response Codes}[https://www.iana.org/assignments/imap-response-codes/imap-response-codes.xhtml]
771789 # * {IMAP Mailbox Name Attributes}[https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml]
772790 # * {IMAP and JMAP Keywords}[https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml]
@@ -777,8 +795,8 @@ module Net
777795 # * {GSSAPI/Kerberos/SASL Service Names}[https://www.iana.org/assignments/gssapi-service-names/gssapi-service-names.xhtml]:
778796 # +imap+
779797 # * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
798+ #
780799 # ==== For currently unsupported features:
781- # * {IMAP Quota Resource Types}[http://www.iana.org/assignments/imap4-capabilities#imap-capabilities-2]
782800 # * {LIST-EXTENDED options and responses}[https://www.iana.org/assignments/imap-list-extended/imap-list-extended.xhtml]
783801 # * {IMAP METADATA Server Entry and Mailbox Entry Registries}[https://www.iana.org/assignments/imap-metadata/imap-metadata.xhtml]
784802 # * {IMAP ANNOTATE Extension Entries and Attributes}[https://www.iana.org/assignments/imap-annotate-extension/imap-annotate-extension.xhtml]
@@ -1848,12 +1866,18 @@ def xlist(refname, mailbox)
18481866 # to both admin and user. If this mailbox exists, it returns an array
18491867 # containing objects of type MailboxQuotaRoot and MailboxQuota.
18501868 #
1869+ # *NOTE:* Currently, Net::IMAP only supports +QUOTA+ responses with a single
1870+ # resource type. This is usually +STORAGE+, but you may need to verify this
1871+ # with UntaggedResponse#raw_data.
1872+ #
18511873 # Related: #getquota, #setquota, MailboxQuotaRoot, MailboxQuota
18521874 #
18531875 # ==== Capabilities
18541876 #
1855- # The server's capabilities must include +QUOTA+
1856- # [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]].
1877+ # Requires +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
1878+ # capability, or a capability prefixed with <tt>QUOTA=RES-*</tt>
1879+ # {[RFC9208]}[https://www.rfc-editor.org/rfc/rfc9208] for each supported
1880+ # resource type.
18571881 def getquotaroot ( mailbox )
18581882 synchronize do
18591883 send_command ( "GETQUOTAROOT" , mailbox )
@@ -1865,41 +1889,55 @@ def getquotaroot(mailbox)
18651889 end
18661890
18671891 # Sends a {GETQUOTA command [RFC2087 §4.2]}[https://www.rfc-editor.org/rfc/rfc2087#section-4.2]
1868- # along with specified +mailbox+. If this mailbox exists, then an array
1869- # containing a MailboxQuota object is returned. This command is generally
1870- # only available to server admin.
1892+ # for the +quota_root+. If this quota root exists, then an array
1893+ # containing a MailboxQuota object is returned.
1894+ #
1895+ # The names of quota roots that are applicable to a particular mailbox can
1896+ # be discovered with #getquotaroot.
1897+ #
1898+ # *NOTE:* Currently, Net::IMAP only supports +QUOTA+ responses with a single
1899+ # resource type. This is usually +STORAGE+, but you may need to verify this
1900+ # with UntaggedResponse#raw_data.
18711901 #
18721902 # Related: #getquotaroot, #setquota, MailboxQuota
18731903 #
18741904 # ==== Capabilities
18751905 #
1876- # The server's capabilities must include +QUOTA+
1877- # [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]].
1878- def getquota ( mailbox )
1906+ # Requires +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
1907+ # capability, or a capability prefixed with <tt>QUOTA=RES-*</tt>
1908+ # {[RFC9208]}[https://www.rfc-editor.org/rfc/rfc9208] for each supported
1909+ # resource type.
1910+ def getquota ( quota_root )
18791911 synchronize do
1880- send_command ( "GETQUOTA" , mailbox )
1912+ send_command ( "GETQUOTA" , quota_root )
18811913 clear_responses ( "QUOTA" )
18821914 end
18831915 end
18841916
18851917 # Sends a {SETQUOTA command [RFC2087 §4.1]}[https://www.rfc-editor.org/rfc/rfc2087#section-4.1]
1886- # along with the specified +mailbox+ and +quota+. If +quota+ is nil, then
1887- # +quota+ will be unset for that mailbox. Typically one needs to be logged
1888- # in as a server admin for this to work.
1918+ # along with the specified +quota_root+ and +storage_limit+. If
1919+ # +storage_limit+ is +nil+, resource limits are unset for that quota root.
1920+ # Otherwise, it sets the +STORAGE+ resource limit.
1921+ #
1922+ # Typically one needs to be logged in as a server admin for this to work.
1923+ #
1924+ # *NOTE:* Currently, Net::IMAP only supports setting +STORAGE+ quota limits.
18891925 #
18901926 # Related: #getquota, #getquotaroot
18911927 #
18921928 # ==== Capabilities
18931929 #
1894- # The server's capabilities must include +QUOTA+
1895- # [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]].
1896- def setquota ( mailbox , quota )
1897- if quota . nil?
1898- data = '()'
1930+ # Requires +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
1931+ # capability, or a capability prefixed with <tt>QUOTA=RES-*</tt>
1932+ # {[RFC9208]}[https://www.rfc-editor.org/rfc/rfc9208] for each supported
1933+ # resource type.
1934+ def setquota ( quota_root , storage_limit )
1935+ if storage_limit . nil?
1936+ list = '()'
18991937 else
1900- data = '(STORAGE ' + quota . to_s + ')'
1938+ list = '(STORAGE ' + storage_limit . to_s + ')'
19011939 end
1902- send_command ( "SETQUOTA" , mailbox , RawData . new ( data ) )
1940+ send_command ( "SETQUOTA" , quota_root , RawData . new ( list ) )
19031941 end
19041942
19051943 # Sends a {SETACL command [RFC4314 §3.1]}[https://www.rfc-editor.org/rfc/rfc4314#section-3.1]
@@ -2006,7 +2044,10 @@ def lsub(refname, mailbox)
20062044 # <tt>STATUS=SIZE</tt>
20072045 # {[RFC8483]}[https://www.rfc-editor.org/rfc/rfc8483.html].
20082046 #
2009- # +DELETED+ requires the server's capabilities to include +IMAP4rev2+.
2047+ # +DELETED+ must be supported when the server's capabilities includes
2048+ # +IMAP4rev2+.
2049+ # or <tt>QUOTA=RES-MESSAGES</tt>
2050+ # {[RFC9208]}[https://www.rfc-editor.org/rfc/rfc9208.html].
20102051 #
20112052 # +HIGHESTMODSEQ+ requires the server's capabilities to include +CONDSTORE+
20122053 # {[RFC7162]}[https://www.rfc-editor.org/rfc/rfc7162.html].
0 commit comments