mail 2.8.0.rc1 → 2.8.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mail/check_delivery_params.rb +65 -0
- data/lib/mail/message.rb +5 -1
- data/lib/mail/version.rb +1 -1
- data/lib/mail.rb +3 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e6dac6546c3b4aabe60abc09fbb055bb2318d2ad65733d8d5fe317146c51de
|
4
|
+
data.tar.gz: 83055f59c22ea5ec023f855d74c22d68031df05b4dc453c9da2e937e255c7bec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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.
|
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-
|
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.
|
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.
|