mail 2.8.0.1.rc1 → 2.8.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6855a8825f3dcfcd94a5ce1fc1244c158eb27c0c34b8ad4d8ddac44499e0369c
4
- data.tar.gz: 1bcf9e9aef234990010b6ea02a27e4079195516ac3bd8c72fdd227c7ca00beef
3
+ metadata.gz: ed5f56296bf04d835348ddd9fff02e4e1f6bbd07a3581b11b39ab58bb2821181
4
+ data.tar.gz: eee50ade410b84312ebbe469ac95e8318d6229b809fb674cff5298c2a61b03a5
5
5
  SHA512:
6
- metadata.gz: dbd4f828d6d4a69f3579d8366e6e2c18f32fdc49107e4ec6ed2fd8d1b1d524cb3fb4287eccf5e647083bcaf954dd32ae933c097692a67f6ac246d0bdb0e3a014
7
- data.tar.gz: 7adf4bc5420cc828b8e911be15f8f0bb0644585dfec309d2b25c3f1c23ec4d6f14bb29f4c58a89b7aacd5318a8ef8cc9a0b88c2206e844f4f79bb1fe68a1fdf7
6
+ metadata.gz: 5fc2ca30906293808e817a24408b1fa42429194ab3ec6ec6f20bd473b5753849df70ade02d6556466b6c92aa0628fb77425eb196877fd7d007b73b86c98b208f
7
+ data.tar.gz: c3a1e1790e8d3d22555e4222f5b0bf04d21ceef8d47c26050e5e2e285c7e72225698dabc19b0dfc6a451833b40d607e686db84a79116e1a4c3de2911002d982f
data/README.md CHANGED
@@ -47,7 +47,21 @@ our documentation, add new features—up to you! Thank you for pitching in.
47
47
 
48
48
  ## Compatibility
49
49
 
50
- Mail supports Ruby 2.5+, including JRuby and TruffleRuby.
50
+ Mail is tested against:
51
+
52
+ * Ruby: 2.5
53
+ * Ruby: 2.6
54
+ * Ruby: 2.7
55
+ * Ruby: 3.0
56
+ * Ruby: 3.1
57
+ * Ruby: 3.2
58
+ * JRuby: 9.2
59
+ * JRuby: 9.3
60
+ * JRuby: 9.4
61
+ * JRuby: stable
62
+ * JRuby: head
63
+ * Truffleruby: stable
64
+ * Truffleruby: head
51
65
 
52
66
  As new versions of Ruby are released, Mail will be compatible with support for the "preview" and all "normal maintenance", "security maintenance" and the two most recent "end of life" versions listed at the [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/) page. Pull requests to assist in adding support for new preview releases are more than welcome.
53
67
 
@@ -49,8 +49,12 @@ module Mail
49
49
  end
50
50
 
51
51
  def initialize(values)
52
+ if values[:arguments].is_a?(String)
53
+ deprecation_warn.call \
54
+ 'Initializing Mail::Sendmail with :arguments of type String is deprecated.' \
55
+ ' Instead ensure :arguments is an array of strings, e.g. ["-i", "-t"]'
56
+ end
52
57
  self.settings = self.class::DEFAULTS.merge(values)
53
- raise ArgumentError, ":arguments expected to be an Array of individual string args" if settings[:arguments].is_a?(String)
54
58
  end
55
59
 
56
60
  def destinations_for(envelope)
@@ -60,8 +64,13 @@ module Mail
60
64
  def deliver!(mail)
61
65
  envelope = Mail::SmtpEnvelope.new(mail)
62
66
 
67
+ arguments = settings[:arguments]
68
+ if arguments.is_a? String
69
+ return old_deliver(envelope)
70
+ end
71
+
63
72
  command = [settings[:location]]
64
- command.concat Array(settings[:arguments])
73
+ command.concat Array(arguments)
65
74
  command.concat [ '-f', envelope.from ] if envelope.from
66
75
 
67
76
  if destinations = destinations_for(envelope)
@@ -83,5 +92,42 @@ module Mail
83
92
  end
84
93
  end
85
94
  end
95
+
96
+ #+ support for delivery using string arguments (deprecated)
97
+ def old_deliver(envelope)
98
+ smtp_from = envelope.from
99
+ smtp_to = destinations_for(envelope)
100
+
101
+ from = "-f #{shellquote(smtp_from)}" if smtp_from
102
+ destination = smtp_to.map { |to| shellquote(to) }.join(' ')
103
+
104
+ arguments = "#{settings[:arguments]} #{from} --"
105
+ command = "#{settings[:location]} #{arguments} #{destination}"
106
+ popen command do |io|
107
+ io.puts ::Mail::Utilities.binary_unsafe_to_lf(envelope.message)
108
+ io.flush
109
+ end
110
+ end
111
+
112
+ # The following is an adaptation of ruby 1.9.2's shellwords.rb file,
113
+ # with the following modifications:
114
+ #
115
+ # - Wraps in double quotes
116
+ # - Allows '+' to accept email addresses with them
117
+ # - Allows '~' as it is not unescaped in double quotes
118
+ def shellquote(address)
119
+ # Process as a single byte sequence because not all shell
120
+ # implementations are multibyte aware.
121
+ #
122
+ # A LF cannot be escaped with a backslash because a backslash + LF
123
+ # combo is regarded as line continuation and simply ignored. Strip it.
124
+ escaped = address.gsub(/([^A-Za-z0-9_\s\+\-.,:\/@~])/n, "\\\\\\1").gsub("\n", '')
125
+ %("#{escaped}")
126
+ end
127
+ #- support for delivery using string arguments
128
+
129
+ def deprecation_warn
130
+ defined?(ActiveSupport::Deprecation.warn) ? ActiveSupport::Deprecation.method(:warn) : Kernel.method(:warn)
131
+ end
86
132
  end
87
133
  end
@@ -135,7 +135,7 @@ module Mail
135
135
  when true
136
136
  smtp.enable_starttls_auto(ssl_context)
137
137
  when false
138
- smtp.disable_starttls_auto
138
+ smtp.disable_starttls
139
139
  else
140
140
  raise ArgumentError, "Unrecognized :enable_starttls_auto value #{settings[:enable_starttls_auto].inspect}; expected true, false, or nil"
141
141
  end
data/lib/mail/version.rb CHANGED
@@ -4,8 +4,8 @@ module Mail
4
4
 
5
5
  MAJOR = 2
6
6
  MINOR = 8
7
- PATCH = 0
8
- BUILD = "1.rc1"
7
+ PATCH = 1
8
+ BUILD = "rc2"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
11
11
 
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.1.rc1
4
+ version: 2.8.1.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: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_mime
@@ -314,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
314
314
  - !ruby/object:Gem::Version
315
315
  version: 1.3.1
316
316
  requirements: []
317
- rubygems_version: 3.3.26
317
+ rubygems_version: 3.1.6
318
318
  signing_key:
319
319
  specification_version: 4
320
320
  summary: Mail provides a nice Ruby DSL for making, sending and reading emails.