Skip to content

Commit 70d57d7

Browse files
committed
💥🔧 Drop deprecated config options for UIDPlusData
1 parent 98db9b7 commit 70d57d7

File tree

1 file changed

+21
-44
lines changed

1 file changed

+21
-44
lines changed

lib/net/imap/config.rb

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -340,28 +340,18 @@ def self.[](config)
340340
#
341341
# Alias for responses_without_block
342342

343+
# **NOTE:** <em>+UIDPlusData+ has been removed since +v0.6.0+, and this
344+
# config option can only be set to +false+. The config option is kept
345+
# only for compatibility and will be removed by +v0.7.0+.</em>
346+
#
343347
# Whether ResponseParser should use the deprecated UIDPlusData or
344348
# CopyUIDData for +COPYUID+ response codes, and UIDPlusData or
345349
# AppendUIDData for +APPENDUID+ response codes.
346350
#
347-
# UIDPlusData stores its data in arrays of numbers, which is vulnerable to
348-
# a memory exhaustion denial of service attack from an untrusted or
349-
# compromised server. Set this option to +false+ to completely block this
350-
# vulnerability. Otherwise, parser_max_deprecated_uidplus_data_size
351-
# mitigates this vulnerability.
352-
#
353-
# AppendUIDData and CopyUIDData are _mostly_ backward-compatible with
354-
# UIDPlusData. Most applications should be able to upgrade with little
355-
# or no changes.
356-
#
357-
# <em>(Parser support for +UIDPLUS+ added in +v0.3.2+.)</em>
358-
#
359-
# <em>(Config option added in +v0.4.19+ and +v0.5.6+.)</em>
351+
# Parser support for +UIDPLUS+ added in +v0.3.2+.
352+
# Config option added in +v0.4.19+ and +v0.5.6+.
360353
#
361-
# <em>UIDPlusData will be removed in +v0.6+ and this config setting will
362-
# be ignored.</em>
363-
#
364-
# ==== Valid options
354+
# ==== Original options
365355
#
366356
# [+true+ <em>(original default)</em>]
367357
# ResponseParser only uses UIDPlusData.
@@ -371,34 +361,21 @@ def self.[](config)
371361
# parser_max_deprecated_uidplus_data_size. Above that size,
372362
# ResponseParser uses AppendUIDData or CopyUIDData.
373363
#
374-
# [+false+ <em>(planned default for +v0.6+)</em>]
364+
# [+false+ <em>(only valid option since +v0.6.0+)</em>]
375365
# ResponseParser _only_ uses AppendUIDData and CopyUIDData.
376-
attr_accessor :parser_use_deprecated_uidplus_data, type: Enum[
377-
true, :up_to_max_size, false
378-
]
366+
attr_accessor :parser_use_deprecated_uidplus_data, type: Enum[false]
379367

368+
# **NOTE:** <em>+UIDPlusData+ has been removed since +v0.6.0+, and this
369+
# config option is ignored. The config option is kept only for
370+
# compatibility and will be removed by +v0.7.0+.</em>
371+
#
380372
# The maximum +uid-set+ size that ResponseParser will parse into
381373
# deprecated UIDPlusData. This limit only applies when
382374
# parser_use_deprecated_uidplus_data is not +false+.
383375
#
384-
# <em>(Parser support for +UIDPLUS+ added in +v0.3.2+.)</em>
385-
#
386-
# <em>Support for limiting UIDPlusData to a maximum size was added in
387-
# +v0.3.8+, +v0.4.19+, and +v0.5.6+.</em>
388-
#
389-
# <em>UIDPlusData will be removed in +v0.6+.</em>
390-
#
391-
# ==== Versioned Defaults
392-
#
393-
# Because this limit guards against a remote server causing catastrophic
394-
# memory exhaustion, the versioned default (used by #load_defaults) also
395-
# applies to versions without the feature.
396-
#
397-
# * +0.3+ and prior: <tt>10,000</tt>
398-
# * +0.4+: <tt>1,000</tt>
399-
# * +0.5+: <tt>100</tt>
400-
# * +0.6+: <tt>0</tt>
401-
#
376+
# Parser support for +UIDPLUS+ added in +v0.3.2+.
377+
# Support for limiting UIDPlusData to a maximum size was added in
378+
# +v0.3.8+ (not configurable), +v0.4.19+, and +v0.5.6+.
402379
attr_accessor :parser_max_deprecated_uidplus_data_size, type: Integer
403380

404381
# Creates a new config object and initialize its attribute with +attrs+.
@@ -495,8 +472,8 @@ def defaults_hash
495472
responses_without_block: :silence_deprecation_warning,
496473
enforce_logindisabled: false,
497474
max_response_size: nil,
498-
parser_use_deprecated_uidplus_data: true,
499-
parser_max_deprecated_uidplus_data_size: 10_000,
475+
# parser_use_deprecated_uidplus_data: true,
476+
# parser_max_deprecated_uidplus_data_size: 10_000,
500477
).freeze
501478
version_defaults[0.0r] = Config[0r]
502479
version_defaults[0.1r] = Config[0r]
@@ -505,15 +482,15 @@ def defaults_hash
505482

506483
version_defaults[0.4r] = Config[0.3r].dup.update(
507484
sasl_ir: true,
508-
parser_max_deprecated_uidplus_data_size: 1000,
485+
# parser_max_deprecated_uidplus_data_size: 1000,
509486
).freeze
510487

511488
version_defaults[0.5r] = Config[0.4r].dup.update(
512489
enforce_logindisabled: true,
513490
max_response_size: 512 << 20, # 512 MiB
514491
responses_without_block: :warn,
515-
parser_use_deprecated_uidplus_data: :up_to_max_size,
516-
parser_max_deprecated_uidplus_data_size: 100,
492+
# parser_use_deprecated_uidplus_data: :up_to_max_size,
493+
# parser_max_deprecated_uidplus_data_size: 100,
517494
).freeze
518495

519496
version_defaults[0.6r] = Config[0.5r].dup.update(

0 commit comments

Comments
 (0)