mail 2.8.0.rc1 → 2.8.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ed25dc984368dd9a0032804a298eb6120e860357a70e7afc170108c700d430e
4
- data.tar.gz: 886556ae37645a3074ca43cf439388c4bcdd164cc4849de76df4cf19345f8893
3
+ metadata.gz: a2e6dac6546c3b4aabe60abc09fbb055bb2318d2ad65733d8d5fe317146c51de
4
+ data.tar.gz: 83055f59c22ea5ec023f855d74c22d68031df05b4dc453c9da2e937e255c7bec
5
5
  SHA512:
6
- metadata.gz: 545f9b3a4a2cb1e752bad67e09cc0f3587d352471db140a35c6b885a9e64e5998b65032ff0d61f731bd1c27ed9a70a46a84c62051c5e419d99e7bf9a14dadbce
7
- data.tar.gz: 727057fbad623dc4eef62840a2b8a5cf65e6c8d469874d497de91e78c2df9ccdbde5090fdffb7b8843ca4e7416c04ca34ab8b544e848dbd62ec25751ac8649ed
6
+ metadata.gz: a7fbca6e0c4d75d5fb7292312e70046a65a2d18a5790bab76c5d9dced2550d6379d5b5de4afc1cf5fbe0b16687b339fe895f935696480427362efb05d7055ba8
7
+ data.tar.gz: 18d2df0deabee8d6797194b96cdf0116057b5ea1d76d2ec64f748c2cc2c38dfe4ff8292995fce390412e16865ccd6cdd7a24c5a1a6b60401b1a695884b480b96
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # This whole class and associated specs is deprecated and will go away in the version 3 release of mail.
4
+ module Mail
5
+ module CheckDeliveryParams #:nodoc:
6
+ class << self
7
+
8
+ extend Gem::Deprecate
9
+
10
+ def check(mail)
11
+ envelope = Mail::SmtpEnvelope.new(mail)
12
+ [ envelope.from,
13
+ envelope.to,
14
+ envelope.message ]
15
+ end
16
+ deprecate :check, 'Mail::SmtpEnvelope.new created in commit c106bebea066782a72e4f24dd37b532d95773df7', 2023, 6
17
+
18
+ def check_from(addr)
19
+ mail = Mail.new(from: 'deprecated@example.com', to: 'deprecated@example.com')
20
+ Mail::SmtpEnvelope.new(mail).send(:validate_addr, 'From', addr)
21
+ end
22
+ deprecate :check_from, :none, 2023, 6
23
+
24
+ def check_to(addrs)
25
+ mail = Mail.new(from: 'deprecated@example.com', to: 'deprecated@example.com')
26
+ Array(addrs).map do |addr|
27
+ Mail::SmtpEnvelope.new(mail).send(:validate_addr, 'To', addr)
28
+ end
29
+ end
30
+ deprecate :check_to, :none, 2023, 6
31
+
32
+ def check_addr(addr_name, addr)
33
+ mail = Mail.new(from: 'deprecated@example.com', to: 'deprecated@example.com')
34
+ Mail::SmtpEnvelope.new(mail).send(:validate_addr, addr_name, addr)
35
+ end
36
+ deprecate :check_addr, :none, 2023, 6
37
+
38
+ def validate_smtp_addr(addr)
39
+ if addr
40
+ if addr.bytesize > 2048
41
+ yield 'may not exceed 2kB'
42
+ end
43
+
44
+ if /[\r\n]/ =~ addr
45
+ yield 'may not contain CR or LF line breaks'
46
+ end
47
+ end
48
+
49
+ addr
50
+ end
51
+ deprecate :validate_smtp_addr, :none, 2023, 6
52
+
53
+ def check_message(message)
54
+ message = message.encoded if message.respond_to?(:encoded)
55
+
56
+ if Utilities.blank?(message)
57
+ raise ArgumentError, 'An encoded message is required to send an email'
58
+ end
59
+
60
+ message
61
+ end
62
+ deprecate :check_message, :none, 2023, 6
63
+ end
64
+ end
65
+ end
data/lib/mail/message.rb CHANGED
@@ -2066,7 +2066,11 @@ module Mail
2066
2066
 
2067
2067
  def add_boundary
2068
2068
  unless body.boundary && boundary
2069
- header['content-type'] = 'multipart/mixed' unless header['content-type']
2069
+ unless header['content-type']
2070
+ _charset = charset
2071
+ header['content-type'] = 'multipart/mixed'
2072
+ header['content-type'].parameters[:charset] = _charset
2073
+ end
2070
2074
  header['content-type'].parameters[:boundary] = ContentTypeField.generate_boundary
2071
2075
  body.boundary = boundary
2072
2076
  end
data/lib/mail/version.rb CHANGED
@@ -5,7 +5,7 @@ module Mail
5
5
  MAJOR = 2
6
6
  MINOR = 8
7
7
  PATCH = 0
8
- BUILD = 'rc1'
8
+ BUILD = 'rc2'
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
11
11
 
data/lib/mail.rb CHANGED
@@ -60,6 +60,9 @@ module Mail # :doc:
60
60
  require 'mail/matchers/has_sent_mail'
61
61
  require 'mail/matchers/attachment_matchers.rb'
62
62
 
63
+ # Deprecated will be removed in 3.0 release
64
+ require 'mail/check_delivery_params'
65
+
63
66
  # Finally... require all the Mail.methods
64
67
  require 'mail/mail'
65
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0.rc1
4
+ version: 2.8.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikel Lindsaar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2022-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_mime
@@ -162,6 +162,7 @@ files:
162
162
  - lib/mail.rb
163
163
  - lib/mail/attachments_list.rb
164
164
  - lib/mail/body.rb
165
+ - lib/mail/check_delivery_params.rb
165
166
  - lib/mail/configuration.rb
166
167
  - lib/mail/constants.rb
167
168
  - lib/mail/elements.rb
@@ -313,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
313
314
  - !ruby/object:Gem::Version
314
315
  version: 1.3.1
315
316
  requirements: []
316
- rubygems_version: 3.0.8
317
+ rubygems_version: 3.1.6
317
318
  signing_key:
318
319
  specification_version: 4
319
320
  summary: Mail provides a nice Ruby DSL for making, sending and reading emails.