mail 2.9.0 → 2.9.1
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.
- checksums.yaml +4 -4
- data/lib/mail/utilities.rb +32 -22
- data/lib/mail/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4a67f21ae487544b4e5643f58bbeefc655aeeb71a8a6b1296f70a3772e45e58
|
|
4
|
+
data.tar.gz: 7db8b4d4900cb78bb51a4384f0415deb80253df509b22f55073289dea07021c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe249426a2cb09c463dae570a5a9d13a19e6e9ffcce643f766102da9033ec69bec69642834a29069ade3909e39962abdfb818eba539fe4a1322a2812e9242c93
|
|
7
|
+
data.tar.gz: 146e604d9cfa857f0485485839ab64334656dd287d059d9fa17d5dd5e71d980c5df4b081b148c99c2d3f841eacfa439aaa0c1e0ab9658181ea57357ba17f41cf
|
data/lib/mail/utilities.rb
CHANGED
|
@@ -416,16 +416,20 @@ module Mail
|
|
|
416
416
|
end
|
|
417
417
|
|
|
418
418
|
def Utilities.b_value_decode(str)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
419
|
+
b_decoded = str.gsub(/=\?([^?]+)\?[Bb]\?([^?]*)\?=/m) do |match|
|
|
420
|
+
charset = $1
|
|
421
|
+
|
|
422
|
+
string = Utilities.decode_base64($2)
|
|
423
|
+
|
|
424
|
+
begin
|
|
425
|
+
charset_encoder.encode(string, charset)
|
|
426
|
+
rescue Encoding::UndefinedConversionError, ArgumentError, Encoding::ConverterNotFoundError, Encoding::InvalidByteSequenceError
|
|
427
|
+
warn "WARNING: Encoding conversion failed #{$!}"
|
|
428
|
+
string.dup.force_encoding(Encoding::UTF_8)
|
|
429
|
+
end
|
|
424
430
|
end
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
warn "WARNING: Encoding conversion failed #{$!}"
|
|
428
|
-
str.dup.force_encoding(Encoding::UTF_8)
|
|
431
|
+
|
|
432
|
+
transcode_to_scrubbed_utf8(b_decoded)
|
|
429
433
|
end
|
|
430
434
|
|
|
431
435
|
def Utilities.q_value_encode(str, encoding = nil)
|
|
@@ -434,22 +438,28 @@ module Mail
|
|
|
434
438
|
end
|
|
435
439
|
|
|
436
440
|
def Utilities.q_value_decode(str)
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
441
|
+
q_decoded = str.gsub(/=\?([^?]+)\?[Qq]\?((?:[^?]|\?(?!\=))*)\?=/m) do |_match|
|
|
442
|
+
charset = $1
|
|
443
|
+
string = $2
|
|
444
|
+
.gsub(/_/, '=20')
|
|
445
|
+
.sub(/\=$/, '') # Remove trailing = if it exists in a Q encoding
|
|
446
|
+
|
|
447
|
+
unquoted_printable = Encodings::QuotedPrintable.decode(string)
|
|
448
|
+
decoded = begin
|
|
449
|
+
charset_encoder.encode(unquoted_printable, charset)
|
|
450
|
+
rescue Encoding::UndefinedConversionError, ArgumentError, Encoding::ConverterNotFoundError
|
|
451
|
+
warn "WARNING: Encoding conversion failed #{$!}"
|
|
452
|
+
unquoted_printable.dup.force_encoding(Encoding::UTF_8)
|
|
453
|
+
end
|
|
454
|
+
|
|
445
455
|
# We assume that binary strings hold utf-8 directly to work around
|
|
446
456
|
# jruby/jruby#829 which subtly changes String#encode semantics.
|
|
447
|
-
|
|
457
|
+
decoded.force_encoding(Encoding::UTF_8) if decoded.encoding == Encoding::ASCII_8BIT
|
|
458
|
+
|
|
459
|
+
decoded
|
|
448
460
|
end
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
warn "WARNING: Encoding conversion failed #{$!}"
|
|
452
|
-
str.dup.force_encoding(Encoding::UTF_8)
|
|
461
|
+
|
|
462
|
+
transcode_to_scrubbed_utf8(q_decoded)
|
|
453
463
|
end
|
|
454
464
|
|
|
455
465
|
def Utilities.param_decode(str, encoding)
|
data/lib/mail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.9.
|
|
4
|
+
version: 2.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikel Lindsaar
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: logger
|
|
@@ -310,7 +309,6 @@ homepage: https://github.com/mikel/mail
|
|
|
310
309
|
licenses:
|
|
311
310
|
- MIT
|
|
312
311
|
metadata: {}
|
|
313
|
-
post_install_message:
|
|
314
312
|
rdoc_options:
|
|
315
313
|
- "--exclude"
|
|
316
314
|
- lib/mail/values/unicode_tables.dat
|
|
@@ -327,8 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
327
325
|
- !ruby/object:Gem::Version
|
|
328
326
|
version: '0'
|
|
329
327
|
requirements: []
|
|
330
|
-
rubygems_version: 3.
|
|
331
|
-
signing_key:
|
|
328
|
+
rubygems_version: 3.6.9
|
|
332
329
|
specification_version: 4
|
|
333
330
|
summary: Mail provides a nice Ruby DSL for making, sending and reading emails.
|
|
334
331
|
test_files: []
|