net-imap 0.5.2 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of net-imap might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +3 -1
- data/docs/styles.css +12 -7
- data/lib/net/imap/command_data.rb +32 -0
- data/lib/net/imap/config.rb +73 -3
- data/lib/net/imap/data_lite.rb +11 -10
- data/lib/net/imap/esearch_result.rb +44 -4
- data/lib/net/imap/fetch_data.rb +126 -47
- data/lib/net/imap/response_data.rb +117 -144
- data/lib/net/imap/response_parser.rb +106 -16
- data/lib/net/imap/sasl/anonymous_authenticator.rb +3 -3
- data/lib/net/imap/sasl/cram_md5_authenticator.rb +3 -3
- data/lib/net/imap/sasl/digest_md5_authenticator.rb +8 -8
- data/lib/net/imap/sasl/external_authenticator.rb +2 -2
- data/lib/net/imap/sasl/gs2_header.rb +7 -7
- data/lib/net/imap/sasl/login_authenticator.rb +2 -2
- data/lib/net/imap/sasl/oauthbearer_authenticator.rb +6 -6
- data/lib/net/imap/sasl/plain_authenticator.rb +7 -7
- data/lib/net/imap/sasl/scram_authenticator.rb +8 -8
- data/lib/net/imap/sasl.rb +1 -1
- data/lib/net/imap/search_result.rb +2 -2
- data/lib/net/imap/sequence_set.rb +193 -58
- data/lib/net/imap/stringprep/nameprep.rb +1 -1
- data/lib/net/imap/stringprep/trace.rb +4 -4
- data/lib/net/imap/uidplus_data.rb +244 -0
- data/lib/net/imap/vanished_data.rb +56 -0
- data/lib/net/imap.rb +325 -161
- data/rakelib/rfcs.rake +2 -0
- metadata +5 -6
@@ -4,8 +4,13 @@ module Net
|
|
4
4
|
class IMAP < Protocol
|
5
5
|
autoload :ESearchResult, "#{__dir__}/esearch_result"
|
6
6
|
autoload :FetchData, "#{__dir__}/fetch_data"
|
7
|
+
autoload :UIDFetchData, "#{__dir__}/fetch_data"
|
7
8
|
autoload :SearchResult, "#{__dir__}/search_result"
|
8
9
|
autoload :SequenceSet, "#{__dir__}/sequence_set"
|
10
|
+
autoload :UIDPlusData, "#{__dir__}/uidplus_data"
|
11
|
+
autoload :AppendUIDData, "#{__dir__}/uidplus_data"
|
12
|
+
autoload :CopyUIDData, "#{__dir__}/uidplus_data"
|
13
|
+
autoload :VanishedData, "#{__dir__}/vanished_data"
|
9
14
|
|
10
15
|
# Net::IMAP::ContinuationRequest represents command continuation requests.
|
11
16
|
#
|
@@ -158,13 +163,20 @@ module Net
|
|
158
163
|
# The raw response data.
|
159
164
|
end
|
160
165
|
|
161
|
-
#
|
166
|
+
# ResponseText represents texts of responses.
|
162
167
|
#
|
163
168
|
# The text may be prefixed by a ResponseCode.
|
164
169
|
#
|
165
|
-
# ResponseText is returned from TaggedResponse#data
|
166
|
-
# UntaggedResponse#data
|
167
|
-
# "
|
170
|
+
# ResponseText is returned from TaggedResponse#data or
|
171
|
+
# UntaggedResponse#data for
|
172
|
+
# {"status responses"}[https://www.rfc-editor.org/rfc/rfc3501#section-7.1]:
|
173
|
+
# * every TaggedResponse, name[rdoc-ref:TaggedResponse#name] is always
|
174
|
+
# "+OK+", "+NO+", or "+BAD+".
|
175
|
+
# * any UntaggedResponse when name[rdoc-ref:UntaggedResponse#name] is
|
176
|
+
# "+OK+", "+NO+", "+BAD+", "+PREAUTH+", or "+BYE+".
|
177
|
+
#
|
178
|
+
# Note that these "status responses" are confusingly _not_ the same as the
|
179
|
+
# +STATUS+ UntaggedResponse (see IMAP#status and StatusData).
|
168
180
|
class ResponseText < Struct.new(:code, :text)
|
169
181
|
# Used to avoid an allocation when ResponseText is empty
|
170
182
|
EMPTY = new(nil, "").freeze
|
@@ -182,32 +194,35 @@ module Net
|
|
182
194
|
# Returns the response text, not including any response code
|
183
195
|
end
|
184
196
|
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
197
|
+
# ResponseCode represents an \IMAP response code, which can be retrieved
|
198
|
+
# from ResponseText#code for
|
199
|
+
# {"status responses"}[https://www.rfc-editor.org/rfc/rfc3501#section-7.1]:
|
200
|
+
# * every TaggedResponse, name[rdoc-ref:TaggedResponse#name] is always
|
201
|
+
# "+OK+", "+NO+", or "+BAD+".
|
202
|
+
# * any UntaggedResponse when name[rdoc-ref:UntaggedResponse#name] is
|
203
|
+
# "+OK+", "+NO+", "+BAD+", "+PREAUTH+", or "+BYE+".
|
204
|
+
#
|
205
|
+
# Note that these "status responses" are confusingly _not_ the same as the
|
206
|
+
# +STATUS+ UntaggedResponse (see IMAP#status and StatusData).
|
189
207
|
#
|
190
208
|
# Some response codes come with additional data which will be parsed by
|
191
209
|
# Net::IMAP. Others return +nil+ for #data, but are used as a
|
192
210
|
# machine-readable annotation for the human-readable ResponseText#text in
|
193
|
-
# the same response.
|
194
|
-
# code text, #data returns the unparsed string.
|
211
|
+
# the same response.
|
195
212
|
#
|
196
213
|
# Untagged response code #data is pushed directly onto Net::IMAP#responses,
|
197
214
|
# keyed by #name, unless it is removed by the command that generated it.
|
198
215
|
# Use Net::IMAP#add_response_handler to view tagged response codes for
|
199
216
|
# command methods that do not return their TaggedResponse.
|
200
217
|
#
|
218
|
+
# == Standard response codes
|
219
|
+
#
|
201
220
|
# \IMAP extensions may define new codes and the data that comes with them.
|
202
221
|
# The IANA {IMAP Response
|
203
222
|
# Codes}[https://www.iana.org/assignments/imap-response-codes/imap-response-codes.xhtml]
|
204
223
|
# registry has links to specifications for all standard response codes.
|
205
|
-
# Response codes are backwards compatible: Servers are allowed to send new
|
206
|
-
# response codes even if the client has not enabled the extension that
|
207
|
-
# defines them. When unknown response code data is encountered, #data
|
208
|
-
# will return an unparsed string.
|
209
224
|
#
|
210
|
-
#
|
225
|
+
# === +IMAP4rev1+ response codes
|
211
226
|
# See [IMAP4rev1[https://www.rfc-editor.org/rfc/rfc3501]] {§7.1, "Server
|
212
227
|
# Responses - Status
|
213
228
|
# Responses"}[https://www.rfc-editor.org/rfc/rfc3501#section-7.1] for full
|
@@ -238,24 +253,24 @@ module Net
|
|
238
253
|
# the <tt>\Seen</tt> flag set.
|
239
254
|
# <em>DEPRECATED by IMAP4rev2.</em>
|
240
255
|
#
|
241
|
-
#
|
256
|
+
# === +BINARY+ extension
|
242
257
|
# See {[RFC3516]}[https://www.rfc-editor.org/rfc/rfc3516].
|
243
258
|
# * +UNKNOWN-CTE+, with a tagged +NO+ response, when the server does not
|
244
259
|
# known how to decode a CTE (content-transfer-encoding). #data is +nil+.
|
245
260
|
# See IMAP#fetch.
|
246
261
|
#
|
247
|
-
#
|
262
|
+
# === +UIDPLUS+ extension
|
248
263
|
# See {[RFC4315 §3]}[https://www.rfc-editor.org/rfc/rfc4315#section-3].
|
249
264
|
# * +APPENDUID+, #data is UIDPlusData. See IMAP#append.
|
250
265
|
# * +COPYUID+, #data is UIDPlusData. See IMAP#copy.
|
251
266
|
# * +UIDNOTSTICKY+, #data is +nil+. See IMAP#select.
|
252
267
|
#
|
253
|
-
#
|
268
|
+
# === +SEARCHRES+ extension
|
254
269
|
# See {[RFC5182]}[https://www.rfc-editor.org/rfc/rfc5182].
|
255
270
|
# * +NOTSAVED+, with a tagged +NO+ response, when the search result variable
|
256
271
|
# is not saved. #data is +nil+.
|
257
272
|
#
|
258
|
-
#
|
273
|
+
# === +RFC5530+ response codes
|
259
274
|
# See {[RFC5530]}[https://www.rfc-editor.org/rfc/rfc5530], "IMAP Response
|
260
275
|
# Codes" for the definition of the following response codes, which are all
|
261
276
|
# machine-readable annotations for the human-readable ResponseText#text, and
|
@@ -278,22 +293,22 @@ module Net
|
|
278
293
|
# * +ALREADYEXISTS+
|
279
294
|
# * +NONEXISTENT+
|
280
295
|
#
|
281
|
-
#
|
296
|
+
# === +QRESYNC+ extension
|
282
297
|
# See {[RFC7162]}[https://www.rfc-editor.org/rfc/rfc7162.html].
|
283
298
|
# * +CLOSED+, returned when the currently selected mailbox is closed
|
284
299
|
# implicitly by selecting or examining another mailbox. #data is +nil+.
|
285
300
|
#
|
286
|
-
#
|
301
|
+
# === +IMAP4rev2+ response codes
|
287
302
|
# See {[RFC9051]}[https://www.rfc-editor.org/rfc/rfc9051] {§7.1, "Server
|
288
303
|
# Responses - Status
|
289
304
|
# Responses"}[https://www.rfc-editor.org/rfc/rfc9051#section-7.1] for full
|
290
305
|
# descriptions of IMAP4rev2 response codes. IMAP4rev2 includes all of the
|
291
|
-
# response codes listed above (except "UNSEEN") and adds the following:
|
306
|
+
# response codes listed above (except "+UNSEEN+") and adds the following:
|
292
307
|
# * +HASCHILDREN+, with a tagged +NO+ response, when a mailbox delete failed
|
293
308
|
# because the server doesn't allow deletion of mailboxes with children.
|
294
309
|
# #data is +nil+.
|
295
310
|
#
|
296
|
-
#
|
311
|
+
# === +CONDSTORE+ extension
|
297
312
|
# See {[RFC7162]}[https://www.rfc-editor.org/rfc/rfc7162.html].
|
298
313
|
# * +NOMODSEQ+, when selecting a mailbox that does not support
|
299
314
|
# mod-sequences. #data is +nil+. See IMAP#select.
|
@@ -303,10 +318,17 @@ module Net
|
|
303
318
|
# since the +UNCHANGEDSINCE+ mod-sequence given to +STORE+ or <tt>UID
|
304
319
|
# STORE</tt>.
|
305
320
|
#
|
306
|
-
#
|
321
|
+
# === +OBJECTID+ extension
|
307
322
|
# See {[RFC8474]}[https://www.rfc-editor.org/rfc/rfc8474.html].
|
308
323
|
# * +MAILBOXID+, #data is a string
|
309
324
|
#
|
325
|
+
# == Extension compatibility
|
326
|
+
#
|
327
|
+
# Response codes are backwards compatible: Servers are allowed to send new
|
328
|
+
# response codes even if the client has not enabled the extension that
|
329
|
+
# defines them. When Net::IMAP does not know how to parse response
|
330
|
+
# code text, #data returns the unparsed string.
|
331
|
+
#
|
310
332
|
class ResponseCode < Struct.new(:name, :data)
|
311
333
|
##
|
312
334
|
# method: name
|
@@ -325,64 +347,8 @@ module Net
|
|
325
347
|
# code data can take.
|
326
348
|
end
|
327
349
|
|
328
|
-
#
|
329
|
-
#
|
330
|
-
#
|
331
|
-
# See [[UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]].
|
332
|
-
#
|
333
|
-
# ==== Capability requirement
|
334
|
-
#
|
335
|
-
# The +UIDPLUS+ capability[rdoc-ref:Net::IMAP#capability] must be supported.
|
336
|
-
# A server that supports +UIDPLUS+ should send a UIDPlusData object inside
|
337
|
-
# every TaggedResponse returned by the append[rdoc-ref:Net::IMAP#append],
|
338
|
-
# copy[rdoc-ref:Net::IMAP#copy], move[rdoc-ref:Net::IMAP#move], {uid
|
339
|
-
# copy}[rdoc-ref:Net::IMAP#uid_copy], and {uid
|
340
|
-
# move}[rdoc-ref:Net::IMAP#uid_move] commands---unless the destination
|
341
|
-
# mailbox reports +UIDNOTSTICKY+.
|
342
|
-
#
|
343
|
-
#--
|
344
|
-
# TODO: support MULTIAPPEND
|
345
|
-
#++
|
346
|
-
#
|
347
|
-
class UIDPlusData < Struct.new(:uidvalidity, :source_uids, :assigned_uids)
|
348
|
-
##
|
349
|
-
# method: uidvalidity
|
350
|
-
# :call-seq: uidvalidity -> nonzero uint32
|
351
|
-
#
|
352
|
-
# The UIDVALIDITY of the destination mailbox.
|
353
|
-
|
354
|
-
##
|
355
|
-
# method: source_uids
|
356
|
-
# :call-seq: source_uids -> nil or an array of nonzero uint32
|
357
|
-
#
|
358
|
-
# The UIDs of the copied or moved messages.
|
359
|
-
#
|
360
|
-
# Note:: Returns +nil+ for Net::IMAP#append.
|
361
|
-
|
362
|
-
##
|
363
|
-
# method: assigned_uids
|
364
|
-
# :call-seq: assigned_uids -> an array of nonzero uint32
|
365
|
-
#
|
366
|
-
# The newly assigned UIDs of the copied, moved, or appended messages.
|
367
|
-
#
|
368
|
-
# Note:: This always returns an array, even when it contains only one UID.
|
369
|
-
|
370
|
-
##
|
371
|
-
# :call-seq: uid_mapping -> nil or a hash
|
372
|
-
#
|
373
|
-
# Returns a hash mapping each source UID to the newly assigned destination
|
374
|
-
# UID.
|
375
|
-
#
|
376
|
-
# Note:: Returns +nil+ for Net::IMAP#append.
|
377
|
-
def uid_mapping
|
378
|
-
source_uids&.zip(assigned_uids)&.to_h
|
379
|
-
end
|
380
|
-
end
|
381
|
-
|
382
|
-
# Net::IMAP::MailboxList represents contents of the LIST response,
|
383
|
-
# representing a single mailbox path.
|
384
|
-
#
|
385
|
-
# Net::IMAP#list returns an array of MailboxList objects.
|
350
|
+
# MailboxList represents the data of an untagged +LIST+ response, for a
|
351
|
+
# _single_ mailbox path. IMAP#list returns an array of MailboxList objects.
|
386
352
|
#
|
387
353
|
class MailboxList < Struct.new(:attr, :delim, :name)
|
388
354
|
##
|
@@ -392,11 +358,11 @@ module Net
|
|
392
358
|
# Returns the name attributes. Each name attribute is a symbol capitalized
|
393
359
|
# by String#capitalize, such as :Noselect (not :NoSelect). For the
|
394
360
|
# semantics of each attribute, see:
|
395
|
-
# *
|
396
|
-
# *
|
397
|
-
# * Net::IMAP@SPECIAL-USE
|
361
|
+
# * Net::IMAP@Basic+Mailbox+Attributes
|
362
|
+
# * Net::IMAP@Mailbox+role+Attributes
|
398
363
|
# * The IANA {IMAP Mailbox Name Attributes
|
399
364
|
# registry}[https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml]
|
365
|
+
# has links to specifications for all standard mailbox attributes.
|
400
366
|
|
401
367
|
##
|
402
368
|
# method: delim
|
@@ -411,16 +377,16 @@ module Net
|
|
411
377
|
# Returns the mailbox name.
|
412
378
|
end
|
413
379
|
|
414
|
-
#
|
415
|
-
# This object can also be a response to GETQUOTAROOT. In the syntax
|
416
|
-
# specification below, the delimiter used with the "#" construct is a
|
417
|
-
# single space (SPACE).
|
380
|
+
# MailboxQuota represents the data of an untagged +QUOTA+ response.
|
418
381
|
#
|
419
|
-
#
|
382
|
+
# IMAP#getquota returns an array of MailboxQuota objects.
|
420
383
|
#
|
421
384
|
# Net::IMAP#getquotaroot returns an array containing both MailboxQuotaRoot
|
422
385
|
# and MailboxQuota objects.
|
423
386
|
#
|
387
|
+
# == Required capability
|
388
|
+
# Requires +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
|
389
|
+
# capability.
|
424
390
|
class MailboxQuota < Struct.new(:mailbox, :usage, :quota)
|
425
391
|
##
|
426
392
|
# method: mailbox
|
@@ -442,12 +408,14 @@ module Net
|
|
442
408
|
#
|
443
409
|
end
|
444
410
|
|
445
|
-
#
|
446
|
-
# response. (GETQUOTAROOT can also return Net::IMAP::MailboxQuota.)
|
411
|
+
# MailboxQuotaRoot represents the data of an untagged +QUOTAROOT+ response.
|
447
412
|
#
|
448
|
-
#
|
449
|
-
#
|
413
|
+
# IMAP#getquotaroot returns an array containing both MailboxQuotaRoot and
|
414
|
+
# MailboxQuota objects.
|
450
415
|
#
|
416
|
+
# == Required capability
|
417
|
+
# Requires +QUOTA+ [RFC2087[https://www.rfc-editor.org/rfc/rfc2087]]
|
418
|
+
# capability.
|
451
419
|
class MailboxQuotaRoot < Struct.new(:mailbox, :quotaroots)
|
452
420
|
##
|
453
421
|
# method: mailbox
|
@@ -462,12 +430,13 @@ module Net
|
|
462
430
|
# Zero or more quotaroots that affect the quota on the specified mailbox.
|
463
431
|
end
|
464
432
|
|
465
|
-
#
|
433
|
+
# MailboxACLItem represents the data of an untagged +ACL+ response.
|
466
434
|
#
|
467
|
-
#
|
435
|
+
# IMAP#getacl returns an array of MailboxACLItem objects.
|
468
436
|
#
|
469
|
-
#
|
470
|
-
# +ACL+
|
437
|
+
# == Required capability
|
438
|
+
# Requires +ACL+ [RFC4314[https://www.rfc-editor.org/rfc/rfc4314]]
|
439
|
+
# capability.
|
471
440
|
class MailboxACLItem < Struct.new(:user, :rights, :mailbox)
|
472
441
|
##
|
473
442
|
# method: mailbox
|
@@ -489,11 +458,12 @@ module Net
|
|
489
458
|
# The access rights the indicated #user has to the #mailbox.
|
490
459
|
end
|
491
460
|
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
# Returned by Net::IMAP#namespace, contained inside a Namespaces object.
|
461
|
+
# Namespace represents a _single_ namespace, contained inside a Namespaces
|
462
|
+
# object.
|
496
463
|
#
|
464
|
+
# == Required capability
|
465
|
+
# Requires either +NAMESPACE+ [RFC2342[https://www.rfc-editor.org/rfc/rfc2342]]
|
466
|
+
# or +IMAP4rev2+ capability.
|
497
467
|
class Namespace < Struct.new(:prefix, :delim, :extensions)
|
498
468
|
##
|
499
469
|
# method: prefix
|
@@ -515,11 +485,14 @@ module Net
|
|
515
485
|
# Extension parameter semantics would be defined by the extension.
|
516
486
|
end
|
517
487
|
|
518
|
-
#
|
519
|
-
#
|
488
|
+
# Namespaces represents the data of an untagged +NAMESPACE+ response,
|
489
|
+
# returned by IMAP#namespace.
|
520
490
|
#
|
521
|
-
#
|
491
|
+
# Contains lists of #personal, #shared, and #other namespaces.
|
522
492
|
#
|
493
|
+
# == Required capability
|
494
|
+
# Requires either +NAMESPACE+ [RFC2342[https://www.rfc-editor.org/rfc/rfc2342]]
|
495
|
+
# or +IMAP4rev2+ capability.
|
523
496
|
class Namespaces < Struct.new(:personal, :other, :shared)
|
524
497
|
##
|
525
498
|
# method: personal
|
@@ -540,9 +513,9 @@ module Net
|
|
540
513
|
# Returns an array of Shared Namespace objects.
|
541
514
|
end
|
542
515
|
|
543
|
-
#
|
516
|
+
# StatusData represents the contents of an untagged +STATUS+ response.
|
544
517
|
#
|
545
|
-
#
|
518
|
+
# IMAP#status returns the contents of #attr.
|
546
519
|
class StatusData < Struct.new(:mailbox, :attr)
|
547
520
|
##
|
548
521
|
# method: mailbox
|
@@ -563,11 +536,11 @@ module Net
|
|
563
536
|
# [Note]
|
564
537
|
# When the #sender and #reply_to fields are absent or empty, they will
|
565
538
|
# return the same value as #from. Also, fields may return values that are
|
566
|
-
# invalid for well-formed [RFC5322[https://
|
539
|
+
# invalid for well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
567
540
|
# messages when the message is malformed or a draft message.
|
568
541
|
#
|
569
|
-
# See [{IMAP4rev1 §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501
|
570
|
-
# and [{IMAP4rev2 §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051
|
542
|
+
# See [{IMAP4rev1 §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501#section-7.4.2]]
|
543
|
+
# and [{IMAP4rev2 §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051#section-7.5.2]]
|
571
544
|
# for full description of the envelope fields, and
|
572
545
|
# Net::IMAP@Message+envelope+and+body+structure for other relevant RFCs.
|
573
546
|
#
|
@@ -581,7 +554,7 @@ module Net
|
|
581
554
|
# Returns a string that represents the +Date+ header.
|
582
555
|
#
|
583
556
|
# [Note]
|
584
|
-
# For a well-formed [RFC5322[https://
|
557
|
+
# For a well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
585
558
|
# message, the #date field must not be +nil+. However it can be +nil+
|
586
559
|
# for a malformed or draft message.
|
587
560
|
|
@@ -607,7 +580,7 @@ module Net
|
|
607
580
|
# returns +nil+ for this envelope field.
|
608
581
|
#
|
609
582
|
# [Note]
|
610
|
-
# For a well-formed [RFC5322[https://
|
583
|
+
# For a well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
611
584
|
# message, the #from field must not be +nil+. However it can be +nil+
|
612
585
|
# for a malformed or draft message.
|
613
586
|
|
@@ -620,7 +593,7 @@ module Net
|
|
620
593
|
# [Note]
|
621
594
|
# If the <tt>Sender</tt> header is absent, or is present but empty, the
|
622
595
|
# server sets this field to be the same value as #from. Therefore, in a
|
623
|
-
# well-formed [RFC5322[https://
|
596
|
+
# well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] message,
|
624
597
|
# the #sender envelope field must not be +nil+. However it can be
|
625
598
|
# +nil+ for a malformed or draft message.
|
626
599
|
|
@@ -634,7 +607,7 @@ module Net
|
|
634
607
|
# [Note]
|
635
608
|
# If the <tt>Reply-To</tt> header is absent, or is present but empty,
|
636
609
|
# the server sets this field to be the same value as #from. Therefore,
|
637
|
-
# in a well-formed [RFC5322[https://
|
610
|
+
# in a well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
638
611
|
# message, the #reply_to envelope field must not be +nil+. However it
|
639
612
|
# can be +nil+ for a malformed or draft message.
|
640
613
|
|
@@ -663,7 +636,7 @@ module Net
|
|
663
636
|
# Returns a string that represents the <tt>In-Reply-To</tt> header.
|
664
637
|
#
|
665
638
|
# [Note]
|
666
|
-
# For a well-formed [RFC5322[https://
|
639
|
+
# For a well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
667
640
|
# message, the #in_reply_to field, if present, must not be empty. But
|
668
641
|
# it can still return an empty string for malformed messages.
|
669
642
|
#
|
@@ -679,7 +652,7 @@ module Net
|
|
679
652
|
# Returns a string that represents the <tt>Message-ID</tt>.
|
680
653
|
#
|
681
654
|
# [Note]
|
682
|
-
# For a well-formed [RFC5322[https://
|
655
|
+
# For a well-formed [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]
|
683
656
|
# message, the #message_id field, if present, must not be empty. But it
|
684
657
|
# can still return an empty string for malformed messages.
|
685
658
|
#
|
@@ -693,10 +666,10 @@ module Net
|
|
693
666
|
# parsed into its component parts by the server. Address objects are
|
694
667
|
# returned within Envelope fields.
|
695
668
|
#
|
696
|
-
#
|
669
|
+
# == Group syntax
|
697
670
|
#
|
698
671
|
# When the #host field is +nil+, this is a special form of address structure
|
699
|
-
# that indicates the [RFC5322[https://
|
672
|
+
# that indicates the [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] group
|
700
673
|
# syntax. If the #mailbox name field is also +nil+, this is an end-of-group
|
701
674
|
# marker (semicolon in RFC-822 syntax). If the #mailbox name field is
|
702
675
|
# non-+NIL+, this is the start of a group marker, and the mailbox #name
|
@@ -706,7 +679,7 @@ module Net
|
|
706
679
|
# method: name
|
707
680
|
# :call-seq: name -> string or nil
|
708
681
|
#
|
709
|
-
# Returns the [RFC5322[https://
|
682
|
+
# Returns the [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] address
|
710
683
|
# +display-name+ (or the mailbox +phrase+ in the RFC-822 grammar).
|
711
684
|
|
712
685
|
##
|
@@ -716,28 +689,28 @@ module Net
|
|
716
689
|
# Returns the route from RFC-822 route-addr.
|
717
690
|
#
|
718
691
|
# Note:: Generating this obsolete route addressing syntax is not allowed
|
719
|
-
# by [RFC5322[https://
|
692
|
+
# by [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]]. However,
|
720
693
|
# addresses with this syntax must still be accepted and parsed.
|
721
694
|
|
722
695
|
##
|
723
696
|
# method: mailbox
|
724
697
|
# :call-seq: mailbox -> string or nil
|
725
698
|
#
|
726
|
-
# Returns the [RFC5322[https://
|
699
|
+
# Returns the [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] address
|
727
700
|
# +local-part+, if #host is not +nil+.
|
728
701
|
#
|
729
702
|
# When #host is +nil+, this returns
|
730
|
-
# an [RFC5322[https://
|
703
|
+
# an [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] group name and a +nil+
|
731
704
|
# mailbox indicates the end of a group.
|
732
705
|
|
733
706
|
##
|
734
707
|
# method: host
|
735
708
|
# :call-seq: host -> string or nil
|
736
709
|
#
|
737
|
-
# Returns the [RFC5322[https://
|
710
|
+
# Returns the [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] addr-spec
|
738
711
|
# +domain+ name.
|
739
712
|
#
|
740
|
-
# +nil+ indicates [RFC5322[https://
|
713
|
+
# +nil+ indicates [RFC5322[https://www.rfc-editor.org/rfc/rfc5322]] group
|
741
714
|
# syntax.
|
742
715
|
end
|
743
716
|
|
@@ -749,14 +722,14 @@ module Net
|
|
749
722
|
# :call-seq: dsp_type -> string
|
750
723
|
#
|
751
724
|
# Returns the content disposition type, as defined by
|
752
|
-
# [DISPOSITION[https://
|
725
|
+
# [DISPOSITION[https://www.rfc-editor.org/rfc/rfc2183]].
|
753
726
|
|
754
727
|
##
|
755
728
|
# method: param
|
756
729
|
# :call-seq: param -> hash
|
757
730
|
#
|
758
731
|
# Returns a hash representing parameters of the Content-Disposition
|
759
|
-
# field, as defined by [DISPOSITION[https://
|
732
|
+
# field, as defined by [DISPOSITION[https://www.rfc-editor.org/rfc/rfc2183]].
|
760
733
|
end
|
761
734
|
|
762
735
|
# Net::IMAP::ThreadMember represents a thread-node returned
|
@@ -795,12 +768,12 @@ module Net
|
|
795
768
|
# FetchData#attr value. Although these classes don't share a base class,
|
796
769
|
# this module can be used to pattern match all of them.
|
797
770
|
#
|
798
|
-
# See {[IMAP4rev1] §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501
|
799
|
-
# and {[IMAP4rev2] §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051
|
771
|
+
# See {[IMAP4rev1] §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501#section-7.4.2]
|
772
|
+
# and {[IMAP4rev2] §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051#section-7.5.2-4.9]
|
800
773
|
# for full description of all +BODYSTRUCTURE+ fields, and also
|
801
774
|
# Net::IMAP@Message+envelope+and+body+structure for other relevant RFCs.
|
802
775
|
#
|
803
|
-
#
|
776
|
+
# == Classes that include BodyStructure
|
804
777
|
# BodyTypeBasic:: Represents any message parts that are not handled by
|
805
778
|
# BodyTypeText, BodyTypeMessage, or BodyTypeMultipart.
|
806
779
|
# BodyTypeText:: Used by <tt>text/*</tt> parts. Contains all of the
|
@@ -818,8 +791,8 @@ module Net
|
|
818
791
|
# message parts, unless they have a <tt>Content-Type</tt> that is handled by
|
819
792
|
# BodyTypeText, BodyTypeMessage, or BodyTypeMultipart.
|
820
793
|
#
|
821
|
-
# See {[IMAP4rev1] §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501
|
822
|
-
# and {[IMAP4rev2] §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051
|
794
|
+
# See {[IMAP4rev1] §7.4.2}[https://www.rfc-editor.org/rfc/rfc3501#section-7.4.2]
|
795
|
+
# and {[IMAP4rev2] §7.5.2}[https://www.rfc-editor.org/rfc/rfc9051#section-7.5.2-4.9]
|
823
796
|
# for full description of all +BODYSTRUCTURE+ fields, and also
|
824
797
|
# Net::IMAP@Message+envelope+and+body+structure for other relevant RFCs.
|
825
798
|
#
|
@@ -836,45 +809,45 @@ module Net
|
|
836
809
|
# :call-seq: media_type -> string
|
837
810
|
#
|
838
811
|
# The top-level media type as defined in
|
839
|
-
# [MIME-IMB[https://
|
812
|
+
# [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]].
|
840
813
|
|
841
814
|
##
|
842
815
|
# method: subtype
|
843
816
|
# :call-seq: subtype -> string
|
844
817
|
#
|
845
818
|
# The media subtype name as defined in
|
846
|
-
# [MIME-IMB[https://
|
819
|
+
# [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]].
|
847
820
|
|
848
821
|
##
|
849
822
|
# method: param
|
850
823
|
# :call-seq: param -> string
|
851
824
|
#
|
852
825
|
# Returns a hash that represents parameters as defined in
|
853
|
-
# [MIME-IMB[https://
|
826
|
+
# [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]].
|
854
827
|
|
855
828
|
##
|
856
829
|
# method: content_id
|
857
830
|
# :call-seq: content_id -> string
|
858
831
|
#
|
859
832
|
# Returns a string giving the content id as defined
|
860
|
-
# in [MIME-IMB[https://
|
861
|
-
# {§7}[https://
|
833
|
+
# in [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]]
|
834
|
+
# {§7}[https://www.rfc-editor.org/rfc/rfc2045#section-7].
|
862
835
|
|
863
836
|
##
|
864
837
|
# method: description
|
865
838
|
# :call-seq: description -> string
|
866
839
|
#
|
867
840
|
# Returns a string giving the content description as defined
|
868
|
-
# in [MIME-IMB[https://
|
869
|
-
# {§8}[https://
|
841
|
+
# in [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]]
|
842
|
+
# {§8}[https://www.rfc-editor.org/rfc/rfc2045#section-8].
|
870
843
|
|
871
844
|
##
|
872
845
|
# method: encoding
|
873
846
|
# :call-seq: encoding -> string
|
874
847
|
#
|
875
848
|
# Returns a string giving the content transfer encoding as defined
|
876
|
-
# in [MIME-IMB[https://
|
877
|
-
# {§6}[https://
|
849
|
+
# in [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]]
|
850
|
+
# {§6}[https://www.rfc-editor.org/rfc/rfc2045#section-6].
|
878
851
|
|
879
852
|
##
|
880
853
|
# method: size
|
@@ -887,7 +860,7 @@ module Net
|
|
887
860
|
# :call-seq: md5 -> string
|
888
861
|
#
|
889
862
|
# Returns a string giving the body MD5 value as defined in
|
890
|
-
# [MD5[https://
|
863
|
+
# [MD5[https://www.rfc-editor.org/rfc/rfc1864]].
|
891
864
|
|
892
865
|
##
|
893
866
|
# method: disposition
|
@@ -895,7 +868,7 @@ module Net
|
|
895
868
|
#
|
896
869
|
# Returns a ContentDisposition object giving the content
|
897
870
|
# disposition, as defined by
|
898
|
-
# [DISPOSITION[https://
|
871
|
+
# [DISPOSITION[https://www.rfc-editor.org/rfc/rfc2183]].
|
899
872
|
|
900
873
|
##
|
901
874
|
# method: language
|
@@ -1063,7 +1036,7 @@ module Net
|
|
1063
1036
|
# call-seq: subtype -> string
|
1064
1037
|
#
|
1065
1038
|
# Returns the content subtype name
|
1066
|
-
# as defined in [MIME-IMB[https://
|
1039
|
+
# as defined in [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]].
|
1067
1040
|
|
1068
1041
|
##
|
1069
1042
|
# method: parts
|
@@ -1077,7 +1050,7 @@ module Net
|
|
1077
1050
|
# call-seq: param -> hash
|
1078
1051
|
#
|
1079
1052
|
# Returns a hash that represents parameters
|
1080
|
-
# as defined in [MIME-IMB[https://
|
1053
|
+
# as defined in [MIME-IMB[https://www.rfc-editor.org/rfc/rfc2045]].
|
1081
1054
|
|
1082
1055
|
##
|
1083
1056
|
# method: disposition
|