Skip to content

Commit f868315

Browse files
committed
Merge branch 'master-3.2' into dist/3.2/bookworm
2 parents b747f09 + 249fe59 commit f868315

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+877
-416
lines changed

.bundle/gems/net-imap-0.3.4.1/lib/net/imap.rb renamed to .bundle/gems/net-imap-0.3.8/lib/net/imap.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,8 @@ module Net
511511
#
512512
# - #greeting: The server's initial untagged response, which can indicate a
513513
# pre-authenticated connection.
514-
# - #responses: The untagged responses, as a hash. Keys are the untagged
515-
# response type (e.g. "OK", "FETCH", "FLAGS") and response code (e.g.
516-
# "ALERT", "UIDVALIDITY", "UIDNEXT", "TRYCREATE", etc). Values are arrays
517-
# of UntaggedResponse or ResponseCode.
514+
# - #responses: A hash with arrays of unhandled <em>non-+nil+</em>
515+
# UntaggedResponse and ResponseCode +#data+, keyed by +#name+.
518516
# - #add_response_handler: Add a block to be called inside the receiver thread
519517
# with every server response.
520518
# - #remove_response_handler: Remove a previously added response handler.
@@ -701,7 +699,7 @@ module Net
701699
# * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
702700
#
703701
class IMAP < Protocol
704-
VERSION = "0.3.4.1"
702+
VERSION = "0.3.8"
705703

706704
include MonitorMixin
707705
if defined?(OpenSSL::SSL)
@@ -712,7 +710,9 @@ class IMAP < Protocol
712710
# Returns the initial greeting the server, an UntaggedResponse.
713711
attr_reader :greeting
714712

715-
# Returns recorded untagged responses.
713+
# Returns a hash with arrays of unhandled <em>non-+nil+</em>
714+
# UntaggedResponse#data keyed by UntaggedResponse#name, and
715+
# ResponseCode#data keyed by ResponseCode#name.
716716
#
717717
# For example:
718718
#

.bundle/gems/net-imap-0.3.4.1/lib/net/imap/authenticators/digest_md5.rb renamed to .bundle/gems/net-imap-0.3.8/lib/net/imap/authenticators/digest_md5.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def process(challenge)
1515
@stage = STAGE_TWO
1616
sparams = {}
1717
c = StringScanner.new(challenge)
18-
while c.scan(/(?:\s*,)?\s*(\w+)=("(?:[^\\"]+|\\.)*"|[^,]+)\s*/)
18+
while c.scan(/(?:\s*,)?\s*(\w+)=("(?:[^\\"]|\\.)*"|[^,]+)\s*/)
1919
k, v = c[1], c[2]
2020
if v =~ /^"(.*)"$/
2121
v = $1
@@ -26,7 +26,7 @@ def process(challenge)
2626
sparams[k] = v
2727
end
2828

29-
raise Net::IMAP::DataFormatError, "Bad Challenge: '#{challenge}'" unless c.eos?
29+
raise Net::IMAP::DataFormatError, "Bad Challenge: '#{challenge}'" unless c.eos? and sparams['qop']
3030
raise Net::IMAP::Error, "Server does not support auth (qop = #{sparams['qop'].join(',')})" unless sparams['qop'].include?("auth")
3131

3232
response = {

.bundle/gems/net-imap-0.3.4.1/lib/net/imap/authenticators/xoauth2.rb renamed to .bundle/gems/net-imap-0.3.8/lib/net/imap/authenticators/xoauth2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def process(_data)
77

88
private
99

10-
def initialize(user, oauth2_token)
10+
def initialize(user, oauth2_token, **_)
1111
@user = user
1212
@oauth2_token = oauth2_token
1313
end

.bundle/gems/net-imap-0.3.4.1/lib/net/imap/data_encoding.rb renamed to .bundle/gems/net-imap-0.3.8/lib/net/imap/data_encoding.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class IMAP < Protocol
5454
# Net::IMAP does _not_ automatically encode and decode
5555
# mailbox names to and from UTF-7.
5656
def self.decode_utf7(s)
57-
return s.gsub(/&([^-]+)?-/n) {
58-
if $1
59-
($1.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
57+
return s.gsub(/&([A-Za-z0-9+,]+)?-/n) {
58+
if base64 = $1
59+
(base64.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
6060
else
6161
"&"
6262
end

.bundle/gems/net-imap-0.3.4.1/lib/net/imap/response_parser.rb renamed to .bundle/gems/net-imap-0.3.8/lib/net/imap/response_parser.rb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class IMAP < Protocol
77

88
# Parses an \IMAP server response.
99
class ResponseParser
10+
MAX_UID_SET_SIZE = 10_000
11+
1012
# :call-seq: Net::IMAP::ResponseParser.new -> Net::IMAP::ResponseParser
1113
def initialize
1214
@str = nil
@@ -1379,11 +1381,29 @@ def uid_set
13791381
case token.symbol
13801382
when T_NUMBER then [Integer(token.value)]
13811383
when T_ATOM
1382-
token.value.split(",").flat_map {|range|
1383-
range = range.split(":").map {|uniqueid| Integer(uniqueid) }
1384-
range.size == 1 ? range : Range.new(range.min, range.max).to_a
1384+
entries = uid_set__ranges(token.value)
1385+
if (count = entries.sum(&:count)) > MAX_UID_SET_SIZE
1386+
parse_error("uid-set is too large: %d > 10k", count)
1387+
end
1388+
entries.flat_map(&:to_a)
1389+
end
1390+
end
1391+
1392+
# returns an array of ranges
1393+
def uid_set__ranges(uidset)
1394+
entries = []
1395+
uidset.split(",") do |entry|
1396+
uids = entry.split(":", 2).map {|uid|
1397+
unless uid =~ /\A[1-9][0-9]*\z/
1398+
parse_error("invalid uid-set uid: %p", uid)
1399+
end
1400+
uid = Integer(uid)
1401+
NumValidator.ensure_nz_number(uid)
1402+
uid
13851403
}
1404+
entries << Range.new(*uids.minmax)
13861405
end
1406+
entries
13871407
end
13881408

13891409
def nil_atom

.bundle/gems/net-imap-0.3.4.1/net-imap.gemspec renamed to .bundle/gems/net-imap-0.3.8/net-imap.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
2525
# Specify which files should be added to the gem when it is released.
2626
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
2727
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28-
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features)/}) }
28+
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features|rfcs)/}) }
2929
end
3030
spec.bindir = "exe"
3131
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

.bundle/specifications/net-imap-0.3.4.1.gemspec renamed to .bundle/specifications/net-imap-0.3.8.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# -*- encoding: utf-8 -*-
2-
# stub: net-imap 0.3.4.1 ruby lib
2+
# stub: net-imap 0.3.8 ruby lib
33

44
Gem::Specification.new do |s|
55
s.name = "net-imap".freeze
6-
s.version = "0.3.4.1"
6+
s.version = "0.3.8"
77

88
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
99
s.metadata = { "homepage_uri" => "https://github.com/ruby/net-imap", "source_code_uri" => "https://github.com/ruby/net-imap" } if s.respond_to? :metadata=
1010
s.require_paths = ["lib".freeze]
1111
s.authors = ["Shugo Maeda".freeze, "nicholas a. evans".freeze]
1212
s.bindir = "exe".freeze
13-
s.date = "2024-01-05"
13+
s.date = "2025-02-07"
1414
s.description = "Ruby client api for Internet Message Access Protocol".freeze
1515
s.email = ["[email protected]".freeze, "[email protected]".freeze]
1616
s.files = [".github/dependabot.yml".freeze, ".github/workflows/test.yml".freeze, ".gitignore".freeze, "Gemfile".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "benchmarks/stringprep.yml".freeze, "benchmarks/table-regexps.yml".freeze, "docs/styles.css".freeze, "lib/net/imap.rb".freeze, "lib/net/imap/authenticators.rb".freeze, "lib/net/imap/authenticators/cram_md5.rb".freeze, "lib/net/imap/authenticators/digest_md5.rb".freeze, "lib/net/imap/authenticators/login.rb".freeze, "lib/net/imap/authenticators/plain.rb".freeze, "lib/net/imap/authenticators/xoauth2.rb".freeze, "lib/net/imap/command_data.rb".freeze, "lib/net/imap/data_encoding.rb".freeze, "lib/net/imap/errors.rb".freeze, "lib/net/imap/flags.rb".freeze, "lib/net/imap/response_data.rb".freeze, "lib/net/imap/response_parser.rb".freeze, "lib/net/imap/sasl.rb".freeze, "lib/net/imap/sasl/saslprep.rb".freeze, "lib/net/imap/sasl/saslprep_tables.rb".freeze, "lib/net/imap/sasl/stringprep.rb".freeze, "lib/net/imap/sasl/stringprep_tables.rb".freeze, "net-imap.gemspec".freeze, "rakelib/rdoc.rake".freeze, "rakelib/rfcs.rake".freeze, "rakelib/saslprep.rake".freeze, "rakelib/string_prep_tables_generator.rb".freeze]

0 commit comments

Comments
 (0)