@@ -152,72 +152,184 @@ module Net
152
152
#
153
153
#
154
154
# == References
155
+ #--
156
+ # TODO: Consider moving references list to REFERENCES.md or REFERENCES.rdoc.
157
+ #++
155
158
#
156
- # [[IMAP[ https://tools.ietf .org/html /rfc3501]]]
157
- # Crispin, M. "INTERNET MESSAGE ACCESS PROTOCOL - \VERSION 4rev1",
158
- # RFC- 3501[https://tools.ietf.org/html/rfc3501] , March 2003. (Note:
159
- # obsoletes RFC-2060[ https://tools.ietf .org/html/rfc2060], December 1996.)
159
+ # [{IMAP4rev1}[ https://www.rfc-editor .org/rfc /rfc3501.html]]::
160
+ # Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - \VERSION 4rev1",
161
+ # RFC 3501, DOI 10.17487/RFC3501 , March 2003,
162
+ # < https://www.rfc-editor .org/info/rfc3501>.
160
163
#
161
- # [[LANGUAGE-TAGS[https://tools.ietf.org/html/rfc1766]]]
162
- # Phillips, A. and Davis, M. "Tags for Identifying Languages",
163
- # RFC-5646[https://tools.ietf.org/html/rfc5646], September 2009.
164
- # (Note: obsoletes
165
- # RFC-3066[https://tools.ietf.org/html/rfc3066], January 2001,
166
- # RFC-4646[https://tools.ietf.org/html/rfc4646], September 2006, and
167
- # RFC-1766[https://tools.ietf.org/html/rfc1766], March 1995.)
164
+ # [IMAP-ABNF-EXT[https://www.rfc-editor.org/rfc/rfc4466.html]]::
165
+ # Melnikov, A. and C. Daboo, "Collected Extensions to IMAP4 ABNF",
166
+ # RFC 4466, DOI 10.17487/RFC4466, April 2006,
167
+ # <https://www.rfc-editor.org/info/rfc4466>.
168
168
#
169
- # [[MD5[https://tools.ietf.org/html/rfc1864]]]
170
- # Myers, J. and M. Rose, "The Content-MD5 Header Field",
171
- # RFC-1864[https://tools.ietf.org/html/rfc1864], October 1995.
169
+ # <em>Note: Net::IMAP cannot parse the entire RFC4466 grammar yet.</em>
170
+ #
171
+ # [{IMAP4rev2}[https://www.rfc-editor.org/rfc/rfc9051.html]]::
172
+ # Melnikov, A., Ed., and B. Leiba, Ed., "Internet Message Access Protocol
173
+ # (\IMAP) - Version 4rev2", RFC 9051, DOI 10.17487/RFC9051, August 2021,
174
+ # <https://www.rfc-editor.org/info/rfc9051>.
175
+ #
176
+ # <em>Note: Net::IMAP is not fully compatible with IMAP4rev2 yet.</em>
177
+ #
178
+ # [IMAP-IMPLEMENTATION[https://www.rfc-editor.org/info/rfc2683]]::
179
+ # Leiba, B., "IMAP4 Implementation Recommendations",
180
+ # RFC 2683, DOI 10.17487/RFC2683, September 1999,
181
+ # <https://www.rfc-editor.org/info/rfc2683>.
182
+ #
183
+ # [IMAP-MULTIACCESS[https://www.rfc-editor.org/info/rfc2180]]::
184
+ # Gahrns, M., "IMAP4 Multi-Accessed Mailbox Practice", RFC 2180, DOI
185
+ # 10.17487/RFC2180, July 1997, <https://www.rfc-editor.org/info/rfc2180>.
186
+ #
187
+ # [UTF7[https://tools.ietf.org/html/rfc2152]]::
188
+ # Goldsmith, D. and M. Davis, "UTF-7 A Mail-Safe Transformation Format of
189
+ # Unicode", RFC 2152, DOI 10.17487/RFC2152, May 1997,
190
+ # <https://www.rfc-editor.org/info/rfc2152>.
191
+ #
192
+ # === Message envelope and body structure
193
+ #
194
+ # [RFC5322[https://tools.ietf.org/html/rfc5322]]::
195
+ # Resnick, P., Ed., "Internet Message Format",
196
+ # RFC 5322, DOI 10.17487/RFC5322, October 2008,
197
+ # <https://www.rfc-editor.org/info/rfc5322>.
172
198
#
173
- # [[MIME-IMB[https://tools.ietf.org/html/rfc2045]]]
174
- # Freed, N. and N. Borenstein, "MIME (Multipurpose Internet
175
- # Mail Extensions) Part One: Format of Internet Message Bodies",
176
- # RFC-2045[https://tools.ietf.org/html/rfc2045], November 1996.
199
+ # <em>Note: obsoletes</em>
200
+ # RFC-2822[https://tools.ietf.org/html/rfc2822]<em> (April 2001) and</em>
201
+ # RFC-822[https://tools.ietf.org/html/rfc822]<em> (August 1982).</em>
177
202
#
178
- # [[RFC-5322[https://tools.ietf.org/html/rfc5322]]]
179
- # Resnick, P., "Internet Message Format",
180
- # RFC-5322[https://tools.ietf.org/html/rfc5322], October 2008.
181
- # (Note: obsoletes
182
- # RFC-2822[https://tools.ietf.org/html/rfc2822], April 2001, and
183
- # RFC-822[https://tools.ietf.org/html/rfc822], August 1982.)
203
+ # [CHARSET[https://tools.ietf.org/html/rfc2978]]::
204
+ # Freed, N. and J. Postel, "IANA Charset Registration Procedures", BCP 19,
205
+ # RFC 2978, DOI 10.17487/RFC2978, October 2000,
206
+ # <https://www.rfc-editor.org/info/rfc2978>.
184
207
#
185
- # [[EXT-QUOTA[https://tools.ietf.org/html/rfc2087]]]
186
- # Myers, J., "IMAP4 QUOTA extension",
187
- # RFC-2087[https://tools.ietf.org/html/rfc2087], January 1997.
208
+ # [DISPOSITION[https://tools.ietf.org/html/rfc2183]]::
209
+ # Troost, R., Dorner, S., and K. Moore, Ed., "Communicating Presentation
210
+ # Information in Internet Messages: The Content-Disposition Header
211
+ # Field", RFC 2183, DOI 10.17487/RFC2183, August 1997,
212
+ # <https://www.rfc-editor.org/info/rfc2183>.
188
213
#
189
- # [[EXT-NAMESPACE[https://tools.ietf.org/html/rfc2342]]]
190
- # Gahrns, M. and Newman, C., "IMAP4 Namespace",
191
- # RFC-2342[https://tools.ietf.org/html/rfc2342], May 1998.
214
+ # [MIME-IMB[https://tools.ietf.org/html/rfc2045]]::
215
+ # Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions
216
+ # (MIME) Part One: Format of Internet Message Bodies",
217
+ # RFC 2045, DOI 10.17487/RFC2045, November 1996,
218
+ # <https://www.rfc-editor.org/info/rfc2045>.
192
219
#
193
- # [[EXT-ID[https://tools.ietf.org/html/rfc2971]]]
194
- # Showalter, T., "IMAP4 ID extension",
195
- # RFC-2971[https://tools.ietf.org/html/rfc2971], October 2000.
220
+ # [MIME-IMT[https://tools.ietf.org/html/rfc2046]]::
221
+ # Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions
222
+ # (MIME) Part Two: Media Types", RFC 2046, DOI 10.17487/RFC2046,
223
+ # November 1996, <https://www.rfc-editor.org/info/rfc2046>.
224
+ #
225
+ # [MIME-HDRS[https://tools.ietf.org/html/rfc2047]]::
226
+ # Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Three:
227
+ # Message Header Extensions for Non-ASCII Text",
228
+ # RFC 2047, DOI 10.17487/RFC2047, November 1996,
229
+ # <https://www.rfc-editor.org/info/rfc2047>.
230
+ #
231
+ # [RFC2231[https://tools.ietf.org/html/rfc2231]]::
232
+ # Freed, N. and K. Moore, "MIME Parameter Value and Encoded Word
233
+ # Extensions: Character Sets, Languages, and Continuations",
234
+ # RFC 2231, DOI 10.17487/RFC2231, November 1997,
235
+ # <https://www.rfc-editor.org/info/rfc2231>.
236
+ #
237
+ # [I18n-HDRS[https://tools.ietf.org/html/rfc6532]]::
238
+ # Yang, A., Steele, S., and N. Freed, "Internationalized Email Headers",
239
+ # RFC 6532, DOI 10.17487/RFC6532, February 2012,
240
+ # <https://www.rfc-editor.org/info/rfc6532>.
241
+ #
242
+ # [LANGUAGE-TAGS[https://www.rfc-editor.org/info/rfc3282]]::
243
+ # Alvestrand, H., "Content Language Headers",
244
+ # RFC 3282, DOI 10.17487/RFC3282, May 2002,
245
+ # <https://www.rfc-editor.org/info/rfc3282>.
246
+ #
247
+ # [LOCATION[https://www.rfc-editor.org/info/rfc2557]]::
248
+ # Palme, J., Hopmann, A., and N. Shelness, "MIME Encapsulation of
249
+ # Aggregate Documents, such as HTML (MHTML)",
250
+ # RFC 2557, DOI 10.17487/RFC2557, March 1999,
251
+ # <https://www.rfc-editor.org/info/rfc2557>.
252
+ #
253
+ # [MD5[https://tools.ietf.org/html/rfc1864]]::
254
+ # Myers, J. and M. Rose, "The Content-MD5 Header Field",
255
+ # RFC 1864, DOI 10.17487/RFC1864, October 1995,
256
+ # <https://www.rfc-editor.org/info/rfc1864>.
196
257
#
197
- # [[EXT-ACL[https://tools.ietf.org/html/rfc4314]]]
198
- # Melnikov, A., "IMAP4 ACL extension",
199
- # RFC-4314[https://tools.ietf.org/html/rfc4314], December 2005. (Note:
200
- # obsoletes RFC-2086[https://tools.ietf.org/html/rfc2086], January 1997.)
258
+ #--
259
+ # TODO: Document IMAP keywords.
201
260
#
202
- # [[EXT-SORT-THREAD[https://tools.ietf.org/html/rfc5256]]]
203
- # Crispin, M. and Muchison, K., "INTERNET MESSAGE ACCESS PROTOCOL - SORT
204
- # and THREAD Extensions", RFC-5256[https://tools.ietf.org/html/rfc5256],
205
- # June 2008.
261
+ # [RFC3503[https://tools.ietf.org/html/rfc3503]]
262
+ # Melnikov, A., "Message Disposition Notification (MDN)
263
+ # profile for Internet Message Access Protocol (IMAP)",
264
+ # RFC 3503, DOI 10.17487/RFC3503, March 2003,
265
+ # <https://www.rfc-editor.org/info/rfc3503>.
266
+ #++
206
267
#
207
- # [[EXT-MOVE[https://tools.ietf.org/html/rfc6851]]]
208
- # Gulbrandsen, A. and Freed, N., "Internet Message Access Protocol (\IMAP) -
209
- # MOVE Extension", RFC-6851[https://tools.ietf.org/html/rfc6851], January
210
- # 2013.
268
+ # === Supported \IMAP Extensions
211
269
#
212
- # [[OSSL]]
213
- # http://www.openssl.org
270
+ # [QUOTA[https://tools.ietf.org/html/rfc2087]]::
271
+ # Myers, J., "IMAP4 QUOTA extension", RFC 2087, DOI 10.17487/RFC2087,
272
+ # January 1997, <https://www.rfc-editor.org/info/rfc2087>.
273
+ #--
274
+ # TODO: test compatibility with updated QUOTA extension:
275
+ # [QUOTA[https://tools.ietf.org/html/rfc9208]]::
276
+ # Melnikov, A., "IMAP QUOTA Extension", RFC 9208, DOI 10.17487/RFC9208,
277
+ # March 2022, <https://www.rfc-editor.org/info/rfc9208>.
278
+ #++
279
+ # [IDLE[https://tools.ietf.org/html/rfc2177]]::
280
+ # Leiba, B., "IMAP4 IDLE command", RFC 2177, DOI 10.17487/RFC2177,
281
+ # June 1997, <https://www.rfc-editor.org/info/rfc2177>.
282
+ # [NAMESPACE[https://tools.ietf.org/html/rfc2342]]::
283
+ # Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342,
284
+ # DOI 10.17487/RFC2342, May 1998, <https://www.rfc-editor.org/info/rfc2342>.
285
+ # [ID[https://tools.ietf.org/html/rfc2971]]::
286
+ # Showalter, T., "IMAP4 ID extension", RFC 2971, DOI 10.17487/RFC2971,
287
+ # October 2000, <https://www.rfc-editor.org/info/rfc2971>.
288
+ # [ACL[https://tools.ietf.org/html/rfc4314]]::
289
+ # Melnikov, A., "IMAP4 Access Control List (ACL) Extension", RFC 4314,
290
+ # DOI 10.17487/RFC4314, December 2005,
291
+ # <https://www.rfc-editor.org/info/rfc4314>.
292
+ # [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]::
293
+ # Crispin, M., "Internet Message Access Protocol (\IMAP) - UIDPLUS
294
+ # extension", RFC 4315, DOI 10.17487/RFC4315, December 2005,
295
+ # <https://www.rfc-editor.org/info/rfc4315>.
296
+ # [SORT[https://tools.ietf.org/html/rfc5256]]::
297
+ # Crispin, M. and K. Murchison, "Internet Message Access Protocol - SORT and
298
+ # THREAD Extensions", RFC 5256, DOI 10.17487/RFC5256, June 2008,
299
+ # <https://www.rfc-editor.org/info/rfc5256>.
300
+ # [THREAD[https://tools.ietf.org/html/rfc5256]]::
301
+ # Crispin, M. and K. Murchison, "Internet Message Access Protocol - SORT and
302
+ # THREAD Extensions", RFC 5256, DOI 10.17487/RFC5256, June 2008,
303
+ # <https://www.rfc-editor.org/info/rfc5256>.
304
+ # [RFC5530[https://www.rfc-editor.org/rfc/rfc5530.html]]::
305
+ # Gulbrandsen, A., "IMAP Response Codes", RFC 5530, DOI 10.17487/RFC5530,
306
+ # May 2009, <https://www.rfc-editor.org/info/rfc5530>.
307
+ # [MOVE[https://tools.ietf.org/html/rfc6851]]::
308
+ # Gulbrandsen, A. and N. Freed, Ed., "Internet Message Access Protocol
309
+ # (\IMAP) - MOVE Extension", RFC 6851, DOI 10.17487/RFC6851, January 2013,
310
+ # <https://www.rfc-editor.org/info/rfc6851>.
214
311
#
215
- # [[RSSL]]
216
- # http://savannah.gnu.org/projects/rubypki
312
+ # === IANA registries
217
313
#
218
- # [[UTF7[https://tools.ietf.org/html/rfc2152]]]
219
- # Goldsmith, D. and Davis, M., "UTF-7: A Mail-Safe Transformation Format of
220
- # Unicode", RFC-2152[https://tools.ietf.org/html/rfc2152], May 1997.
314
+ # * {IMAP Capabilities}[http://www.iana.org/assignments/imap4-capabilities]
315
+ # * {IMAP Response Codes}[https://www.iana.org/assignments/imap-response-codes/imap-response-codes.xhtml]
316
+ # * {IMAP Mailbox Name Attributes}[https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml]
317
+ # * {IMAP and JMAP Keywords}[https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml]
318
+ # * {IMAP Threading Algorithms}[https://www.iana.org/assignments/imap-threading-algorithms/imap-threading-algorithms.xhtml]
319
+ #--
320
+ # * {IMAP Quota Resource Types}[http://www.iana.org/assignments/imap4-capabilities#imap-capabilities-2]
321
+ # * [{LIST-EXTENDED options and responses}[https://www.iana.org/assignments/imap-list-extended/imap-list-extended.xhtml]
322
+ # * {IMAP METADATA Server Entry and Mailbox Entry Registries}[https://www.iana.org/assignments/imap-metadata/imap-metadata.xhtml]
323
+ # * {IMAP ANNOTATE Extension Entries and Attributes}[https://www.iana.org/assignments/imap-annotate-extension/imap-annotate-extension.xhtml]
324
+ # * {IMAP URLAUTH Access Identifiers and Prefixes}[https://www.iana.org/assignments/urlauth-access-ids/urlauth-access-ids.xhtml]
325
+ # * {IMAP URLAUTH Authorization Mechanism Registry}[https://www.iana.org/assignments/urlauth-authorization-mechanism-registry/urlauth-authorization-mechanism-registry.xhtml]
326
+ #++
327
+ # * {SASL Mechanisms and SASL SCRAM Family Mechanisms}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
328
+ # * {Service Name and Transport Protocol Port Number Registry}[https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml]:
329
+ # +imap+: tcp/143, +imaps+: tcp/993
330
+ # * {GSSAPI/Kerberos/SASL Service Names}[https://www.iana.org/assignments/gssapi-service-names/gssapi-service-names.xhtml]:
331
+ # +imap+
332
+ # * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
221
333
#
222
334
class IMAP < Protocol
223
335
VERSION = "0.3.1"
@@ -341,7 +453,7 @@ def capability
341
453
# )
342
454
# end
343
455
#
344
- # See [EXT- ID[https://tools.ietf.org/html/rfc2971]] for field definitions.
456
+ # See [ID[https://tools.ietf.org/html/rfc2971]] for field definitions.
345
457
def id ( client_id = nil )
346
458
synchronize do
347
459
send_command ( "ID" , ClientID . new ( client_id ) )
@@ -597,7 +709,7 @@ def list(refname, mailbox)
597
709
# end
598
710
# end
599
711
#
600
- # The NAMESPACE extension is described in [EXT- NAMESPACE[https://tools.ietf.org/html/rfc2342]]
712
+ # The NAMESPACE extension is described in [NAMESPACE[https://tools.ietf.org/html/rfc2342]]
601
713
def namespace
602
714
synchronize do
603
715
send_command ( "NAMESPACE" )
@@ -642,7 +754,7 @@ def xlist(refname, mailbox)
642
754
# If this mailbox exists, it returns an array containing objects of type
643
755
# Net::IMAP::MailboxQuotaRoot and Net::IMAP::MailboxQuota.
644
756
#
645
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
757
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
646
758
def getquotaroot ( mailbox )
647
759
synchronize do
648
760
send_command ( "GETQUOTAROOT" , mailbox )
@@ -658,7 +770,7 @@ def getquotaroot(mailbox)
658
770
# Net::IMAP::MailboxQuota object is returned. This
659
771
# command is generally only available to server admin.
660
772
#
661
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
773
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
662
774
def getquota ( mailbox )
663
775
synchronize do
664
776
send_command ( "GETQUOTA" , mailbox )
@@ -671,7 +783,7 @@ def getquota(mailbox)
671
783
# mailbox. Typically one needs to be logged in as a server admin
672
784
# for this to work.
673
785
#
674
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
786
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
675
787
def setquota ( mailbox , quota )
676
788
if quota . nil?
677
789
data = '()'
@@ -685,7 +797,7 @@ def setquota(mailbox, quota)
685
797
# +rights+ that user is to have on that mailbox. If +rights+ is nil,
686
798
# then that user will be stripped of any rights to that mailbox.
687
799
#
688
- # The ACL extension is described in [EXT- ACL[https://tools.ietf.org/html/rfc4314]]
800
+ # The ACL extension is described in [ACL[https://tools.ietf.org/html/rfc4314]]
689
801
def setacl ( mailbox , user , rights )
690
802
if rights . nil?
691
803
send_command ( "SETACL" , mailbox , user , "" )
@@ -698,7 +810,7 @@ def setacl(mailbox, user, rights)
698
810
# If this mailbox exists, an array containing objects of
699
811
# Net::IMAP::MailboxACLItem will be returned.
700
812
#
701
- # The ACL extension is described in [EXT- ACL[https://tools.ietf.org/html/rfc4314]]
813
+ # The ACL extension is described in [ACL[https://tools.ietf.org/html/rfc4314]]
702
814
def getacl ( mailbox )
703
815
synchronize do
704
816
send_command ( "GETACL" , mailbox )
@@ -1011,14 +1123,14 @@ def uid_move(set, mailbox)
1011
1123
# p imap.sort(["DATE"], ["SUBJECT", "hello"], "US-ASCII")
1012
1124
# #=> [6, 7, 8, 1]
1013
1125
#
1014
- # The SORT extension is described in [EXT- SORT-THREAD [https://tools.ietf.org/html/rfc5256]].
1126
+ # The SORT extension is described in [SORT[https://tools.ietf.org/html/rfc5256]].
1015
1127
def sort ( sort_keys , search_keys , charset )
1016
1128
return sort_internal ( "SORT" , sort_keys , search_keys , charset )
1017
1129
end
1018
1130
1019
1131
# Similar to #sort, but returns an array of unique identifiers.
1020
1132
#
1021
- # The SORT extension is described in [EXT- SORT-THREAD [https://tools.ietf.org/html/rfc5256]].
1133
+ # The SORT extension is described in [SORT[https://tools.ietf.org/html/rfc5256]].
1022
1134
def uid_sort ( sort_keys , search_keys , charset )
1023
1135
return sort_internal ( "UID SORT" , sort_keys , search_keys , charset )
1024
1136
end
@@ -1057,15 +1169,15 @@ def remove_response_handler(handler)
1057
1169
# Unlike #search, +charset+ is a required argument. US-ASCII
1058
1170
# and UTF-8 are sample values.
1059
1171
#
1060
- # The THREAD extension is described in [EXT-SORT- THREAD[https://tools.ietf.org/html/rfc5256]].
1172
+ # The THREAD extension is described in [THREAD[https://tools.ietf.org/html/rfc5256]].
1061
1173
def thread ( algorithm , search_keys , charset )
1062
1174
return thread_internal ( "THREAD" , algorithm , search_keys , charset )
1063
1175
end
1064
1176
1065
1177
# Similar to #thread, but returns unique identifiers instead of
1066
1178
# message sequence numbers.
1067
1179
#
1068
- # The THREAD extension is described in [EXT-SORT- THREAD[https://tools.ietf.org/html/rfc5256]].
1180
+ # The THREAD extension is described in [THREAD[https://tools.ietf.org/html/rfc5256]].
1069
1181
def uid_thread ( algorithm , search_keys , charset )
1070
1182
return thread_internal ( "UID THREAD" , algorithm , search_keys , charset )
1071
1183
end
0 commit comments