mail 2.8.1 → 2.9.0.beta2
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/README.md +76 -31
- data/lib/mail/attachments_list.rb +3 -1
- data/lib/mail/body.rb +28 -28
- data/lib/mail/encodings/quoted_printable.rb +1 -1
- data/lib/mail/encodings/unix_to_unix.rb +1 -1
- data/lib/mail/encodings.rb +2 -2
- data/lib/mail/field.rb +65 -35
- data/lib/mail/field_list.rb +1 -1
- data/lib/mail/fields/bcc_field.rb +0 -1
- data/lib/mail/fields/cc_field.rb +0 -1
- data/lib/mail/fields/comments_field.rb +0 -1
- data/lib/mail/fields/common_address_field.rb +9 -17
- data/lib/mail/fields/common_date_field.rb +0 -2
- data/lib/mail/fields/common_message_id_field.rb +0 -1
- data/lib/mail/fields/content_description_field.rb +0 -1
- data/lib/mail/fields/content_disposition_field.rb +0 -2
- data/lib/mail/fields/content_id_field.rb +0 -1
- data/lib/mail/fields/content_location_field.rb +0 -1
- data/lib/mail/fields/content_transfer_encoding_field.rb +0 -1
- data/lib/mail/fields/content_type_field.rb +5 -6
- data/lib/mail/fields/date_field.rb +0 -1
- data/lib/mail/fields/from_field.rb +0 -1
- data/lib/mail/fields/in_reply_to_field.rb +0 -1
- data/lib/mail/fields/keywords_field.rb +0 -1
- data/lib/mail/fields/message_id_field.rb +0 -1
- data/lib/mail/fields/mime_version_field.rb +1 -2
- data/lib/mail/fields/named_structured_field.rb +0 -1
- data/lib/mail/fields/named_unstructured_field.rb +0 -1
- data/lib/mail/fields/optional_field.rb +0 -1
- data/lib/mail/fields/received_field.rb +0 -1
- data/lib/mail/fields/references_field.rb +0 -1
- data/lib/mail/fields/reply_to_field.rb +0 -1
- data/lib/mail/fields/resent_bcc_field.rb +0 -1
- data/lib/mail/fields/resent_cc_field.rb +0 -1
- data/lib/mail/fields/resent_date_field.rb +0 -1
- data/lib/mail/fields/resent_from_field.rb +0 -1
- data/lib/mail/fields/resent_message_id_field.rb +0 -1
- data/lib/mail/fields/resent_sender_field.rb +0 -1
- data/lib/mail/fields/resent_to_field.rb +0 -1
- data/lib/mail/fields/return_path_field.rb +0 -1
- data/lib/mail/fields/sender_field.rb +0 -1
- data/lib/mail/fields/structured_field.rb +0 -1
- data/lib/mail/fields/subject_field.rb +0 -1
- data/lib/mail/fields/to_field.rb +0 -1
- data/lib/mail/fields/unstructured_field.rb +0 -1
- data/lib/mail/fields.rb +9 -0
- data/lib/mail/header.rb +1 -1
- data/lib/mail/mail.rb +32 -27
- data/lib/mail/message.rb +23 -20
- data/lib/mail/multibyte/chars.rb +1 -1
- data/lib/mail/multibyte/unicode.rb +1 -1
- data/lib/mail/network/delivery_methods/file_delivery.rb +2 -2
- data/lib/mail/network/delivery_methods/sendmail.rb +2 -48
- data/lib/mail/network/delivery_methods/smtp.rb +77 -42
- data/lib/mail/network/delivery_methods/smtp_connection.rb +7 -7
- data/lib/mail/network/delivery_methods/test_mailer.rb +4 -4
- data/lib/mail/network/retriever_methods/base.rb +5 -5
- data/lib/mail/network/retriever_methods/imap.rb +6 -3
- data/lib/mail/network/retriever_methods/pop3.rb +20 -20
- data/lib/mail/parsers/address_lists_parser.rb +8 -5
- data/lib/mail/parsers/address_lists_parser.rl +4 -0
- data/lib/mail/parsers/content_disposition_parser.rb +15 -12
- data/lib/mail/parsers/content_disposition_parser.rl +4 -0
- data/lib/mail/parsers/content_location_parser.rb +9 -6
- data/lib/mail/parsers/content_location_parser.rl +5 -1
- data/lib/mail/parsers/content_transfer_encoding_parser.rb +8 -5
- data/lib/mail/parsers/content_transfer_encoding_parser.rl +4 -0
- data/lib/mail/parsers/content_type_parser.rb +15 -12
- data/lib/mail/parsers/content_type_parser.rl +4 -0
- data/lib/mail/parsers/date_time_parser.rb +8 -5
- data/lib/mail/parsers/date_time_parser.rl +4 -0
- data/lib/mail/parsers/envelope_from_parser.rb +8 -5
- data/lib/mail/parsers/envelope_from_parser.rl +4 -0
- data/lib/mail/parsers/message_ids_parser.rb +8 -5
- data/lib/mail/parsers/message_ids_parser.rl +4 -0
- data/lib/mail/parsers/mime_version_parser.rb +8 -5
- data/lib/mail/parsers/mime_version_parser.rl +4 -0
- data/lib/mail/parsers/phrase_lists_parser.rb +8 -5
- data/lib/mail/parsers/phrase_lists_parser.rl +4 -0
- data/lib/mail/parsers/received_parser.rb +8 -5
- data/lib/mail/parsers/received_parser.rl +4 -0
- data/lib/mail/part.rb +19 -19
- data/lib/mail/smtp_envelope.rb +1 -1
- data/lib/mail/utilities.rb +11 -7
- data/lib/mail/version.rb +3 -3
- data/lib/mail.rb +2 -5
- metadata +17 -4
- data/lib/mail/check_delivery_params.rb +0 -65
data/lib/mail.rb
CHANGED
@@ -48,7 +48,7 @@ module Mail # :doc:
|
|
48
48
|
require 'mail/field'
|
49
49
|
require 'mail/field_list'
|
50
50
|
|
51
|
-
|
51
|
+
register_autoload :Envelope, 'mail/envelope'
|
52
52
|
|
53
53
|
# Autoload header field elements and transfer encodings.
|
54
54
|
require 'mail/elements'
|
@@ -58,10 +58,7 @@ module Mail # :doc:
|
|
58
58
|
require 'mail/encodings/unix_to_unix'
|
59
59
|
|
60
60
|
require 'mail/matchers/has_sent_mail'
|
61
|
-
require 'mail/matchers/attachment_matchers
|
62
|
-
|
63
|
-
# Deprecated will be removed in 3.0 release
|
64
|
-
require 'mail/check_delivery_params'
|
61
|
+
require 'mail/matchers/attachment_matchers'
|
65
62
|
|
66
63
|
# Finally... require all the Mail.methods
|
67
64
|
require 'mail/mail'
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikel Lindsaar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: logger
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: mini_mime
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +176,6 @@ files:
|
|
162
176
|
- lib/mail.rb
|
163
177
|
- lib/mail/attachments_list.rb
|
164
178
|
- lib/mail/body.rb
|
165
|
-
- lib/mail/check_delivery_params.rb
|
166
179
|
- lib/mail/configuration.rb
|
167
180
|
- lib/mail/constants.rb
|
168
181
|
- lib/mail/elements.rb
|
@@ -314,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
327
|
- !ruby/object:Gem::Version
|
315
328
|
version: '0'
|
316
329
|
requirements: []
|
317
|
-
rubygems_version: 3.
|
330
|
+
rubygems_version: 3.5.23
|
318
331
|
signing_key:
|
319
332
|
specification_version: 4
|
320
333
|
summary: Mail provides a nice Ruby DSL for making, sending and reading emails.
|
@@ -1,65 +0,0 @@
|
|
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
|