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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -31
  3. data/lib/mail/attachments_list.rb +3 -1
  4. data/lib/mail/body.rb +28 -28
  5. data/lib/mail/encodings/quoted_printable.rb +1 -1
  6. data/lib/mail/encodings/unix_to_unix.rb +1 -1
  7. data/lib/mail/encodings.rb +2 -2
  8. data/lib/mail/field.rb +65 -35
  9. data/lib/mail/field_list.rb +1 -1
  10. data/lib/mail/fields/bcc_field.rb +0 -1
  11. data/lib/mail/fields/cc_field.rb +0 -1
  12. data/lib/mail/fields/comments_field.rb +0 -1
  13. data/lib/mail/fields/common_address_field.rb +9 -17
  14. data/lib/mail/fields/common_date_field.rb +0 -2
  15. data/lib/mail/fields/common_message_id_field.rb +0 -1
  16. data/lib/mail/fields/content_description_field.rb +0 -1
  17. data/lib/mail/fields/content_disposition_field.rb +0 -2
  18. data/lib/mail/fields/content_id_field.rb +0 -1
  19. data/lib/mail/fields/content_location_field.rb +0 -1
  20. data/lib/mail/fields/content_transfer_encoding_field.rb +0 -1
  21. data/lib/mail/fields/content_type_field.rb +5 -6
  22. data/lib/mail/fields/date_field.rb +0 -1
  23. data/lib/mail/fields/from_field.rb +0 -1
  24. data/lib/mail/fields/in_reply_to_field.rb +0 -1
  25. data/lib/mail/fields/keywords_field.rb +0 -1
  26. data/lib/mail/fields/message_id_field.rb +0 -1
  27. data/lib/mail/fields/mime_version_field.rb +1 -2
  28. data/lib/mail/fields/named_structured_field.rb +0 -1
  29. data/lib/mail/fields/named_unstructured_field.rb +0 -1
  30. data/lib/mail/fields/optional_field.rb +0 -1
  31. data/lib/mail/fields/received_field.rb +0 -1
  32. data/lib/mail/fields/references_field.rb +0 -1
  33. data/lib/mail/fields/reply_to_field.rb +0 -1
  34. data/lib/mail/fields/resent_bcc_field.rb +0 -1
  35. data/lib/mail/fields/resent_cc_field.rb +0 -1
  36. data/lib/mail/fields/resent_date_field.rb +0 -1
  37. data/lib/mail/fields/resent_from_field.rb +0 -1
  38. data/lib/mail/fields/resent_message_id_field.rb +0 -1
  39. data/lib/mail/fields/resent_sender_field.rb +0 -1
  40. data/lib/mail/fields/resent_to_field.rb +0 -1
  41. data/lib/mail/fields/return_path_field.rb +0 -1
  42. data/lib/mail/fields/sender_field.rb +0 -1
  43. data/lib/mail/fields/structured_field.rb +0 -1
  44. data/lib/mail/fields/subject_field.rb +0 -1
  45. data/lib/mail/fields/to_field.rb +0 -1
  46. data/lib/mail/fields/unstructured_field.rb +0 -1
  47. data/lib/mail/fields.rb +9 -0
  48. data/lib/mail/header.rb +1 -1
  49. data/lib/mail/mail.rb +32 -27
  50. data/lib/mail/message.rb +23 -20
  51. data/lib/mail/multibyte/chars.rb +1 -1
  52. data/lib/mail/multibyte/unicode.rb +1 -1
  53. data/lib/mail/network/delivery_methods/file_delivery.rb +2 -2
  54. data/lib/mail/network/delivery_methods/sendmail.rb +2 -48
  55. data/lib/mail/network/delivery_methods/smtp.rb +77 -42
  56. data/lib/mail/network/delivery_methods/smtp_connection.rb +7 -7
  57. data/lib/mail/network/delivery_methods/test_mailer.rb +4 -4
  58. data/lib/mail/network/retriever_methods/base.rb +5 -5
  59. data/lib/mail/network/retriever_methods/imap.rb +6 -3
  60. data/lib/mail/network/retriever_methods/pop3.rb +20 -20
  61. data/lib/mail/parsers/address_lists_parser.rb +8 -5
  62. data/lib/mail/parsers/address_lists_parser.rl +4 -0
  63. data/lib/mail/parsers/content_disposition_parser.rb +15 -12
  64. data/lib/mail/parsers/content_disposition_parser.rl +4 -0
  65. data/lib/mail/parsers/content_location_parser.rb +9 -6
  66. data/lib/mail/parsers/content_location_parser.rl +5 -1
  67. data/lib/mail/parsers/content_transfer_encoding_parser.rb +8 -5
  68. data/lib/mail/parsers/content_transfer_encoding_parser.rl +4 -0
  69. data/lib/mail/parsers/content_type_parser.rb +15 -12
  70. data/lib/mail/parsers/content_type_parser.rl +4 -0
  71. data/lib/mail/parsers/date_time_parser.rb +8 -5
  72. data/lib/mail/parsers/date_time_parser.rl +4 -0
  73. data/lib/mail/parsers/envelope_from_parser.rb +8 -5
  74. data/lib/mail/parsers/envelope_from_parser.rl +4 -0
  75. data/lib/mail/parsers/message_ids_parser.rb +8 -5
  76. data/lib/mail/parsers/message_ids_parser.rl +4 -0
  77. data/lib/mail/parsers/mime_version_parser.rb +8 -5
  78. data/lib/mail/parsers/mime_version_parser.rl +4 -0
  79. data/lib/mail/parsers/phrase_lists_parser.rb +8 -5
  80. data/lib/mail/parsers/phrase_lists_parser.rl +4 -0
  81. data/lib/mail/parsers/received_parser.rb +8 -5
  82. data/lib/mail/parsers/received_parser.rl +4 -0
  83. data/lib/mail/part.rb +19 -19
  84. data/lib/mail/smtp_envelope.rb +1 -1
  85. data/lib/mail/utilities.rb +11 -7
  86. data/lib/mail/version.rb +3 -3
  87. data/lib/mail.rb +2 -5
  88. metadata +17 -4
  89. 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
- require 'mail/envelope'
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.rb'
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.8.1
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: 2023-02-03 00:00:00.000000000 Z
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.1.6
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