@@ -152,66 +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>.
198
+ #
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>
172
202
#
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 .
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> .
177
207
#
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.)
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>.
184
213
#
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.
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>.
219
+ #
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>.
188
257
#
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.
258
+ #--
259
+ # TODO: Document IMAP keywords.
192
260
#
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.
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
+ #++
196
267
#
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.)
268
+ # === Supported \IMAP Extensions
201
269
#
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.
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>.
206
311
#
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.
312
+ # === IANA registries
211
313
#
212
- # [[UTF7[https://tools.ietf.org/html/rfc2152]]]
213
- # Goldsmith, D. and Davis, M., "UTF-7: A Mail-Safe Transformation Format of
214
- # 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]
215
333
#
216
334
class IMAP < Protocol
217
335
VERSION = "0.3.1"
@@ -334,7 +452,7 @@ def capability
334
452
# )
335
453
# end
336
454
#
337
- # See [EXT- ID[https://tools.ietf.org/html/rfc2971]] for field definitions.
455
+ # See [ID[https://tools.ietf.org/html/rfc2971]] for field definitions.
338
456
def id ( client_id = nil )
339
457
synchronize do
340
458
send_command ( "ID" , ClientID . new ( client_id ) )
@@ -590,7 +708,7 @@ def list(refname, mailbox)
590
708
# end
591
709
# end
592
710
#
593
- # The NAMESPACE extension is described in [EXT- NAMESPACE[https://tools.ietf.org/html/rfc2342]]
711
+ # The NAMESPACE extension is described in [NAMESPACE[https://tools.ietf.org/html/rfc2342]]
594
712
def namespace
595
713
synchronize do
596
714
send_command ( "NAMESPACE" )
@@ -635,7 +753,7 @@ def xlist(refname, mailbox)
635
753
# If this mailbox exists, it returns an array containing objects of type
636
754
# Net::IMAP::MailboxQuotaRoot and Net::IMAP::MailboxQuota.
637
755
#
638
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
756
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
639
757
def getquotaroot ( mailbox )
640
758
synchronize do
641
759
send_command ( "GETQUOTAROOT" , mailbox )
@@ -651,7 +769,7 @@ def getquotaroot(mailbox)
651
769
# Net::IMAP::MailboxQuota object is returned. This
652
770
# command is generally only available to server admin.
653
771
#
654
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
772
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
655
773
def getquota ( mailbox )
656
774
synchronize do
657
775
send_command ( "GETQUOTA" , mailbox )
@@ -664,7 +782,7 @@ def getquota(mailbox)
664
782
# mailbox. Typically one needs to be logged in as a server admin
665
783
# for this to work.
666
784
#
667
- # The QUOTA extension is described in [EXT- QUOTA[https://tools.ietf.org/html/rfc2087]]
785
+ # The QUOTA extension is described in [QUOTA[https://tools.ietf.org/html/rfc2087]]
668
786
def setquota ( mailbox , quota )
669
787
if quota . nil?
670
788
data = '()'
@@ -678,7 +796,7 @@ def setquota(mailbox, quota)
678
796
# +rights+ that user is to have on that mailbox. If +rights+ is nil,
679
797
# then that user will be stripped of any rights to that mailbox.
680
798
#
681
- # The ACL extension is described in [EXT- ACL[https://tools.ietf.org/html/rfc4314]]
799
+ # The ACL extension is described in [ACL[https://tools.ietf.org/html/rfc4314]]
682
800
def setacl ( mailbox , user , rights )
683
801
if rights . nil?
684
802
send_command ( "SETACL" , mailbox , user , "" )
@@ -691,7 +809,7 @@ def setacl(mailbox, user, rights)
691
809
# If this mailbox exists, an array containing objects of
692
810
# Net::IMAP::MailboxACLItem will be returned.
693
811
#
694
- # The ACL extension is described in [EXT- ACL[https://tools.ietf.org/html/rfc4314]]
812
+ # The ACL extension is described in [ACL[https://tools.ietf.org/html/rfc4314]]
695
813
def getacl ( mailbox )
696
814
synchronize do
697
815
send_command ( "GETACL" , mailbox )
@@ -1004,14 +1122,14 @@ def uid_move(set, mailbox)
1004
1122
# p imap.sort(["DATE"], ["SUBJECT", "hello"], "US-ASCII")
1005
1123
# #=> [6, 7, 8, 1]
1006
1124
#
1007
- # The SORT extension is described in [EXT- SORT-THREAD [https://tools.ietf.org/html/rfc5256]].
1125
+ # The SORT extension is described in [SORT[https://tools.ietf.org/html/rfc5256]].
1008
1126
def sort ( sort_keys , search_keys , charset )
1009
1127
return sort_internal ( "SORT" , sort_keys , search_keys , charset )
1010
1128
end
1011
1129
1012
1130
# Similar to #sort, but returns an array of unique identifiers.
1013
1131
#
1014
- # The SORT extension is described in [EXT- SORT-THREAD [https://tools.ietf.org/html/rfc5256]].
1132
+ # The SORT extension is described in [SORT[https://tools.ietf.org/html/rfc5256]].
1015
1133
def uid_sort ( sort_keys , search_keys , charset )
1016
1134
return sort_internal ( "UID SORT" , sort_keys , search_keys , charset )
1017
1135
end
@@ -1050,15 +1168,15 @@ def remove_response_handler(handler)
1050
1168
# Unlike #search, +charset+ is a required argument. US-ASCII
1051
1169
# and UTF-8 are sample values.
1052
1170
#
1053
- # The THREAD extension is described in [EXT-SORT- THREAD[https://tools.ietf.org/html/rfc5256]].
1171
+ # The THREAD extension is described in [THREAD[https://tools.ietf.org/html/rfc5256]].
1054
1172
def thread ( algorithm , search_keys , charset )
1055
1173
return thread_internal ( "THREAD" , algorithm , search_keys , charset )
1056
1174
end
1057
1175
1058
1176
# Similar to #thread, but returns unique identifiers instead of
1059
1177
# message sequence numbers.
1060
1178
#
1061
- # The THREAD extension is described in [EXT-SORT- THREAD[https://tools.ietf.org/html/rfc5256]].
1179
+ # The THREAD extension is described in [THREAD[https://tools.ietf.org/html/rfc5256]].
1062
1180
def uid_thread ( algorithm , search_keys , charset )
1063
1181
return thread_internal ( "UID THREAD" , algorithm , search_keys , charset )
1064
1182
end
0 commit comments