net-smtp 0.4.0.1 → 0.5.1
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/LICENSE.txt +2 -22
- data/NEWS.md +19 -0
- data/lib/net/smtp/auth_xoauth2.rb +17 -0
- data/lib/net/smtp/authenticator.rb +12 -1
- data/lib/net/smtp.rb +96 -71
- data/net-smtp.gemspec +31 -0
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc084bee5387c51eea4508e77ce6ccd2b220f4d090f91bccfb4fc3626142a3f2
|
4
|
+
data.tar.gz: a011fe3a47fc5119090e7beed0900e83f62b34c5ecbd7b2fe8453c2c7518cdd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c4a47233280c89cc17360933fbdcd460c6b7e70e9023fda38ffa20f89d8afdbbd1c3cbf2d4f7db99e88aeea0e4dab5160a7b9f2d5638918372469fb531632b
|
7
|
+
data.tar.gz: a24a46eaada8bfe12b8e8e3f07e0db393a00c6db847581276f9a4263e334c93d29d31fc0792f80002415e9ace43059e160d22723bab89721b275b604cbdb83f3
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
4
|
-
modification, are permitted provided that the following conditions
|
5
|
-
are met:
|
6
|
-
1. Redistributions of source code must retain the above copyright
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
8
|
-
2. Redistributions in binary form must reproduce the above copyright
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
10
|
-
documentation and/or other materials provided with the distribution.
|
11
|
-
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
-
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
-
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
-
SUCH DAMAGE.
|
1
|
+
All the files in this distribution are covered under either the Ruby license or
|
2
|
+
the BSD-2-Clause license (see the file COPYING).
|
data/NEWS.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# NEWS
|
2
2
|
|
3
|
+
## Version 0.5.0 (2024-03-27)
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Allow case-insensitive strings for SASL mechanism <https://github.com/ruby/net-smtp/pull/64>
|
8
|
+
* Make #auth_capable? public <https://github.com/ruby/net-smtp/pull/63>
|
9
|
+
* Add XOAUTH2 authenticator <https://github.com/ruby/net-smtp/pull/80>
|
10
|
+
|
11
|
+
### Others
|
12
|
+
|
13
|
+
* Remove unused private auth_method <https://github.com/ruby/net-smtp/pull/67>
|
14
|
+
* Delegate checking auth args to the authenticator <https://github.com/ruby/net-smtp/pull/73>
|
15
|
+
* Updated docs, especially TLS and SASL-related <https://github.com/ruby/net-smtp/pull/66>
|
16
|
+
* Renew test certificates <https://github.com/ruby/net-smtp/pull/75>
|
17
|
+
* Fix version extraction to work with non ASCII characters with any LANG <https://github.com/ruby/net-smtp/pull/76>
|
18
|
+
* Replace non-ASCII EM DASH (U+2014) with ASCII hyphen (U+002D) <https://github.com/ruby/net-smtp/pull/78>
|
19
|
+
* Use reusing workflow for Ruby versions <https://github.com/ruby/net-smtp/pull/79>
|
20
|
+
* Make the test suite compatible with --enable-frozen-string-literal <https://github.com/ruby/net-smtp/pull/81>
|
21
|
+
|
3
22
|
## Version 0.4.0 (2023-09-20)
|
4
23
|
|
5
24
|
### Improvements
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Net::SMTP
|
2
|
+
class AuthXoauth2 < Net::SMTP::Authenticator
|
3
|
+
auth_type :xoauth2
|
4
|
+
|
5
|
+
def auth(user, secret)
|
6
|
+
token = xoauth2_string(user, secret)
|
7
|
+
|
8
|
+
finish("AUTH XOAUTH2 #{base64_encode(token)}")
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def xoauth2_string(user, secret)
|
14
|
+
"user=#{user}\1auth=Bearer #{secret}\1\1"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -6,11 +6,22 @@ module Net
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.auth_type(type)
|
9
|
+
type = type.to_s.upcase.tr(?_, ?-).to_sym
|
9
10
|
Authenticator.auth_classes[type] = self
|
10
11
|
end
|
11
12
|
|
12
13
|
def self.auth_class(type)
|
13
|
-
|
14
|
+
type = type.to_s.upcase.tr(?_, ?-).to_sym
|
15
|
+
Authenticator.auth_classes[type]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.check_args(user_arg = nil, secret_arg = nil, *, **)
|
19
|
+
unless user_arg
|
20
|
+
raise ArgumentError, 'SMTP-AUTH requested but missing user name'
|
21
|
+
end
|
22
|
+
unless secret_arg
|
23
|
+
raise ArgumentError, 'SMTP-AUTH requested but missing secret phrase'
|
24
|
+
end
|
14
25
|
end
|
15
26
|
|
16
27
|
attr_reader :smtp
|
data/lib/net/smtp.rb
CHANGED
@@ -79,13 +79,13 @@ module Net
|
|
79
79
|
# == What is This Library?
|
80
80
|
#
|
81
81
|
# This library provides functionality to send internet
|
82
|
-
# mail via SMTP, the Simple Mail Transfer Protocol. For details of
|
83
|
-
# SMTP itself, see [RFC5321
|
84
|
-
# This library also implements SMTP authentication, which is often
|
82
|
+
# mail via \SMTP, the Simple Mail Transfer Protocol. For details of
|
83
|
+
# \SMTP itself, see [RFC5321[https://www.rfc-editor.org/rfc/rfc5321.txt]].
|
84
|
+
# This library also implements \SMTP authentication, which is often
|
85
85
|
# necessary for message composers to submit messages to their
|
86
|
-
# outgoing SMTP server, see
|
87
|
-
# [RFC6409
|
88
|
-
# and [SMTPUTF8
|
86
|
+
# outgoing \SMTP server, see
|
87
|
+
# [RFC6409[https://www.rfc-editor.org/rfc/rfc6409.html]],
|
88
|
+
# and [SMTPUTF8[https://www.rfc-editor.org/rfc/rfc6531.txt]], which is
|
89
89
|
# necessary to send messages to/from addresses containing characters
|
90
90
|
# outside the ASCII range.
|
91
91
|
#
|
@@ -93,18 +93,20 @@ module Net
|
|
93
93
|
#
|
94
94
|
# This library does NOT provide functions to compose internet mails.
|
95
95
|
# You must create them by yourself. If you want better mail support,
|
96
|
-
# try
|
96
|
+
# try the mail[https://rubygems.org/gems/mail] or
|
97
|
+
# rmail[https://rubygems.org/gems/rmail] gems, or search for alternatives in
|
97
98
|
# {RubyGems.org}[https://rubygems.org/] or {The Ruby
|
98
99
|
# Toolbox}[https://www.ruby-toolbox.com/].
|
99
100
|
#
|
100
|
-
# FYI: the official specification on internet mail is:
|
101
|
+
# FYI: the official specification on internet mail is:
|
102
|
+
# [RFC5322[https://www.rfc-editor.org/rfc/rfc5322.txt]].
|
101
103
|
#
|
102
104
|
# == Examples
|
103
105
|
#
|
104
106
|
# === Sending Messages
|
105
107
|
#
|
106
|
-
# You must open a connection to an SMTP server before sending messages.
|
107
|
-
# The first argument is the address of your SMTP server, and the second
|
108
|
+
# You must open a connection to an \SMTP server before sending messages.
|
109
|
+
# The first argument is the address of your \SMTP server, and the second
|
108
110
|
# argument is the port number. Using SMTP.start with a block is the simplest
|
109
111
|
# way to do this. This way, the SMTP connection is closed automatically
|
110
112
|
# after the block is executed.
|
@@ -114,7 +116,7 @@ module Net
|
|
114
116
|
# # Use the SMTP object smtp only in this block.
|
115
117
|
# end
|
116
118
|
#
|
117
|
-
# Replace 'your.smtp.server' with your SMTP server. Normally
|
119
|
+
# Replace 'your.smtp.server' with your \SMTP server. Normally
|
118
120
|
# your system manager or internet provider supplies a server
|
119
121
|
# for you.
|
120
122
|
#
|
@@ -147,7 +149,7 @@ module Net
|
|
147
149
|
# smtp.send_message msgstr, 'from@address', 'to@address'
|
148
150
|
# smtp.finish
|
149
151
|
#
|
150
|
-
# You can also use the block form of SMTP.start
|
152
|
+
# You can also use the block form of SMTP.start or SMTP#start. This closes
|
151
153
|
# the SMTP session automatically:
|
152
154
|
#
|
153
155
|
# # using block form of SMTP.start
|
@@ -160,34 +162,37 @@ module Net
|
|
160
162
|
# === HELO domain
|
161
163
|
#
|
162
164
|
# In almost all situations, you must provide a third argument
|
163
|
-
# to SMTP.start
|
165
|
+
# to SMTP.start or SMTP#start. This is the domain name which you are on
|
164
166
|
# (the host to send mail from). It is called the "HELO domain".
|
165
|
-
# The SMTP server will judge whether it should send or reject
|
167
|
+
# The \SMTP server will judge whether it should send or reject
|
166
168
|
# the SMTP session by inspecting the HELO domain.
|
167
169
|
#
|
168
|
-
# Net::SMTP.start('your.smtp.server', 25
|
169
|
-
#
|
170
|
+
# Net::SMTP.start('your.smtp.server', 25, helo: 'mail.from.domain') do |smtp|
|
171
|
+
# smtp.send_message msgstr, 'from@address', 'to@address'
|
172
|
+
# end
|
170
173
|
#
|
171
|
-
# === SMTP Authentication
|
174
|
+
# === \SMTP Authentication
|
172
175
|
#
|
173
|
-
# The Net::SMTP class supports
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
176
|
+
# The Net::SMTP class supports the \SMTP extension for SASL Authentication
|
177
|
+
# [RFC4954[https://www.rfc-editor.org/rfc/rfc4954.html]] and the following
|
178
|
+
# SASL mechanisms: +PLAIN+, +LOGIN+ _(deprecated)_, and +CRAM-MD5+
|
179
|
+
# _(deprecated)_.
|
180
|
+
#
|
181
|
+
# To use \SMTP authentication, pass extra arguments to
|
182
|
+
# SMTP.start or SMTP#start.
|
177
183
|
#
|
178
184
|
# # PLAIN
|
179
|
-
# Net::SMTP.start('your.smtp.server', 25
|
185
|
+
# Net::SMTP.start('your.smtp.server', 25,
|
180
186
|
# user: 'Your Account', secret: 'Your Password', authtype: :plain)
|
181
|
-
# # LOGIN
|
182
|
-
# Net::SMTP.start('your.smtp.server', 25
|
183
|
-
# user: 'Your Account', secret: 'Your Password', authtype: :login)
|
184
187
|
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
+
# Support for other SASL mechanisms-such as +EXTERNAL+, +OAUTHBEARER+,
|
189
|
+
# +SCRAM-SHA-256+, and +XOAUTH2+-will be added in a future release.
|
190
|
+
#
|
191
|
+
# The +LOGIN+ and +CRAM-MD5+ mechanisms are still available for backwards
|
192
|
+
# compatibility, but are deprecated and should be avoided.
|
188
193
|
#
|
189
194
|
class SMTP < Protocol
|
190
|
-
VERSION = "0.
|
195
|
+
VERSION = "0.5.1"
|
191
196
|
|
192
197
|
# The default SMTP port number, 25.
|
193
198
|
def SMTP.default_port
|
@@ -229,10 +234,13 @@ module Net
|
|
229
234
|
# If the hostname in the server certificate is different from +address+,
|
230
235
|
# it can be specified with +tls_hostname+.
|
231
236
|
#
|
232
|
-
# Additional SSLContext
|
233
|
-
# +
|
237
|
+
# Additional SSLContext[https://ruby.github.io/openssl/OpenSSL/SSL/SSLContext.html]
|
238
|
+
# params can be added to the +ssl_context_params+ hash argument and are
|
239
|
+
# passed to {OpenSSL::SSL::SSLContext#set_params}[https://ruby.github.io/openssl/OpenSSL/SSL/SSLContext.html#method-i-set_params].
|
240
|
+
#
|
241
|
+
# <tt>tls_verify: true</tt> is equivalent to <tt>ssl_context_params: {
|
242
|
+
# verify_mode: OpenSSL::SSL::VERIFY_PEER }</tt>.
|
234
243
|
#
|
235
|
-
# +tls_verify: true+ is equivalent to +ssl_context_params: { verify_mode: OpenSSL::SSL::VERIFY_PEER }+.
|
236
244
|
# This method does not open the TCP connection. You can use
|
237
245
|
# SMTP.start instead of SMTP.new if you want to do everything
|
238
246
|
# at once. Otherwise, follow SMTP.new with SMTP#start.
|
@@ -316,12 +324,13 @@ module Net
|
|
316
324
|
auth_capable?('CRAM-MD5')
|
317
325
|
end
|
318
326
|
|
327
|
+
# Returns whether the server advertises support for the authentication type.
|
328
|
+
# You cannot get valid result before opening SMTP session.
|
319
329
|
def auth_capable?(type)
|
320
330
|
return nil unless @capabilities
|
321
331
|
return false unless @capabilities['AUTH']
|
322
332
|
@capabilities['AUTH'].include?(type)
|
323
333
|
end
|
324
|
-
private :auth_capable?
|
325
334
|
|
326
335
|
# Returns supported authentication methods on this server.
|
327
336
|
# You cannot get valid value before opening SMTP session.
|
@@ -338,7 +347,7 @@ module Net
|
|
338
347
|
|
339
348
|
alias ssl? tls?
|
340
349
|
|
341
|
-
# Enables SMTP/TLS (SMTPS: SMTP over direct TLS connection) for
|
350
|
+
# Enables SMTP/TLS (SMTPS: \SMTP over direct TLS connection) for
|
342
351
|
# this object. Must be called before the connection is established
|
343
352
|
# to have any effect. +context+ is a OpenSSL::SSL::SSLContext object.
|
344
353
|
def enable_tls(context = nil)
|
@@ -457,7 +466,10 @@ module Net
|
|
457
466
|
#
|
458
467
|
# This method is equivalent to:
|
459
468
|
#
|
460
|
-
# Net::SMTP.new(address, port
|
469
|
+
# Net::SMTP.new(address, port, tls_verify: flag, tls_hostname: hostname, ssl_context_params: nil)
|
470
|
+
# .start(helo: helo_domain, user: account, secret: password, authtype: authtype)
|
471
|
+
#
|
472
|
+
# See also: Net::SMTP.new, #start
|
461
473
|
#
|
462
474
|
# === Example
|
463
475
|
#
|
@@ -482,12 +494,6 @@ module Net
|
|
482
494
|
# +helo+ is the _HELO_ _domain_ provided by the client to the
|
483
495
|
# server (see overview comments); it defaults to 'localhost'.
|
484
496
|
#
|
485
|
-
# The remaining arguments are used for SMTP authentication, if required
|
486
|
-
# or desired. +user+ is the account name; +secret+ is your password
|
487
|
-
# or other authentication token; and +authtype+ is the authentication
|
488
|
-
# type, one of :plain, :login, or :cram_md5. See the discussion of
|
489
|
-
# SMTP Authentication in the overview notes.
|
490
|
-
#
|
491
497
|
# If +tls+ is true, enable TLS. The default is false.
|
492
498
|
# If +starttls+ is :always, enable STARTTLS, if +:auto+, use STARTTLS when the server supports it,
|
493
499
|
# if false, disable STARTTLS.
|
@@ -496,10 +502,26 @@ module Net
|
|
496
502
|
# If the hostname in the server certificate is different from +address+,
|
497
503
|
# it can be specified with +tls_hostname+.
|
498
504
|
#
|
499
|
-
# Additional SSLContext
|
500
|
-
# +
|
505
|
+
# Additional SSLContext[https://ruby.github.io/openssl/OpenSSL/SSL/SSLContext.html]
|
506
|
+
# params can be added to the +ssl_context_params+ hash argument and are
|
507
|
+
# passed to {OpenSSL::SSL::SSLContext#set_params}[https://ruby.github.io/openssl/OpenSSL/SSL/SSLContext.html#method-i-set_params].
|
501
508
|
#
|
502
|
-
#
|
509
|
+
# <tt>tls_verify: true</tt> is equivalent to <tt>ssl_context_params: {
|
510
|
+
# verify_mode: OpenSSL::SSL::VERIFY_PEER }</tt>.
|
511
|
+
#
|
512
|
+
# The remaining arguments are used for \SMTP authentication, if required or
|
513
|
+
# desired.
|
514
|
+
#
|
515
|
+
# +authtype+ is the SASL authentication mechanism.
|
516
|
+
#
|
517
|
+
# +user+ is the authentication or authorization identity.
|
518
|
+
#
|
519
|
+
# +secret+ or +password+ is your password or other authentication token.
|
520
|
+
#
|
521
|
+
# These will be sent to #authenticate as positional arguments-the exact
|
522
|
+
# semantics are dependent on the +authtype+.
|
523
|
+
#
|
524
|
+
# See the discussion of Net::SMTP@SMTP+Authentication in the overview notes.
|
503
525
|
#
|
504
526
|
# === Errors
|
505
527
|
#
|
@@ -527,7 +549,7 @@ module Net
|
|
527
549
|
new(address, port, tls: tls, starttls: starttls, tls_verify: tls_verify, tls_hostname: tls_hostname, ssl_context_params: ssl_context_params).start(helo: helo, user: user, secret: secret, authtype: authtype, &block)
|
528
550
|
end
|
529
551
|
|
530
|
-
# +true+ if the SMTP session has been started.
|
552
|
+
# +true+ if the \SMTP session has been started.
|
531
553
|
def started?
|
532
554
|
@started
|
533
555
|
end
|
@@ -544,11 +566,21 @@ module Net
|
|
544
566
|
# +helo+ is the _HELO_ _domain_ that you'll dispatch mails from; see
|
545
567
|
# the discussion in the overview notes.
|
546
568
|
#
|
547
|
-
#
|
548
|
-
#
|
549
|
-
#
|
550
|
-
#
|
551
|
-
#
|
569
|
+
# The remaining arguments are used for \SMTP authentication, if required or
|
570
|
+
# desired.
|
571
|
+
#
|
572
|
+
# +authtype+ is the SASL authentication mechanism.
|
573
|
+
#
|
574
|
+
# +user+ is the authentication or authorization identity.
|
575
|
+
#
|
576
|
+
# +secret+ or +password+ is your password or other authentication token.
|
577
|
+
#
|
578
|
+
# These will be sent to #authenticate as positional arguments-the exact
|
579
|
+
# semantics are dependent on the +authtype+.
|
580
|
+
#
|
581
|
+
# See the discussion of Net::SMTP@SMTP+Authentication in the overview notes.
|
582
|
+
#
|
583
|
+
# See also: Net::SMTP.start
|
552
584
|
#
|
553
585
|
# === Block Usage
|
554
586
|
#
|
@@ -633,9 +665,8 @@ module Net
|
|
633
665
|
|
634
666
|
def do_start(helo_domain, user, secret, authtype)
|
635
667
|
raise IOError, 'SMTP session already started' if @started
|
636
|
-
if user
|
637
|
-
|
638
|
-
check_auth_args user, secret
|
668
|
+
if user || secret || authtype
|
669
|
+
check_auth_args authtype, user, secret
|
639
670
|
end
|
640
671
|
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
|
641
672
|
tcp_socket(@address, @port)
|
@@ -831,32 +862,26 @@ module Net
|
|
831
862
|
|
832
863
|
DEFAULT_AUTH_TYPE = :plain
|
833
864
|
|
865
|
+
# Authenticates with the server, using the "AUTH" command.
|
866
|
+
#
|
867
|
+
# +authtype+ is the name of a SASL authentication mechanism.
|
868
|
+
#
|
869
|
+
# All arguments-other than +authtype+-are forwarded to the authenticator.
|
870
|
+
# Different authenticators may interpret the +user+ and +secret+
|
871
|
+
# arguments differently.
|
834
872
|
def authenticate(user, secret, authtype = DEFAULT_AUTH_TYPE)
|
835
|
-
|
836
|
-
check_auth_args user, secret
|
873
|
+
check_auth_args authtype, user, secret
|
837
874
|
authenticator = Authenticator.auth_class(authtype).new(self)
|
838
875
|
authenticator.auth(user, secret)
|
839
876
|
end
|
840
877
|
|
841
878
|
private
|
842
879
|
|
843
|
-
def
|
844
|
-
|
880
|
+
def check_auth_args(type, *args, **kwargs)
|
881
|
+
type ||= DEFAULT_AUTH_TYPE
|
882
|
+
klass = Authenticator.auth_class(type) or
|
845
883
|
raise ArgumentError, "wrong authentication type #{type}"
|
846
|
-
|
847
|
-
end
|
848
|
-
|
849
|
-
def auth_method(type)
|
850
|
-
"auth_#{type.to_s.downcase}".intern
|
851
|
-
end
|
852
|
-
|
853
|
-
def check_auth_args(user, secret, authtype = DEFAULT_AUTH_TYPE)
|
854
|
-
unless user
|
855
|
-
raise ArgumentError, 'SMTP-AUTH requested but missing user name'
|
856
|
-
end
|
857
|
-
unless secret
|
858
|
-
raise ArgumentError, 'SMTP-AUTH requested but missing secret phrase'
|
859
|
-
end
|
884
|
+
klass.check_args(*args, **kwargs)
|
860
885
|
end
|
861
886
|
|
862
887
|
#
|
data/net-smtp.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
name = File.basename(__FILE__, ".gemspec")
|
4
|
+
version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
|
5
|
+
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb"), :encoding => "UTF-8") do |line|
|
6
|
+
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
|
7
|
+
end rescue nil
|
8
|
+
end
|
9
|
+
|
10
|
+
Gem::Specification.new do |spec|
|
11
|
+
spec.name = name
|
12
|
+
spec.version = version
|
13
|
+
spec.authors = ["Yukihiro Matsumoto"]
|
14
|
+
spec.email = ["matz@ruby-lang.org"]
|
15
|
+
|
16
|
+
spec.summary = %q{Simple Mail Transfer Protocol client library for Ruby.}
|
17
|
+
spec.description = %q{Simple Mail Transfer Protocol client library for Ruby.}
|
18
|
+
spec.homepage = "https://github.com/ruby/net-smtp"
|
19
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
20
|
+
spec.required_ruby_version = ">= 2.6.0"
|
21
|
+
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
24
|
+
|
25
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
26
|
+
`git ls-files README.md NEWS.md LICENSE.txt net-smtp.gemspec lib`.split
|
27
|
+
end
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_dependency "net-protocol"
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-smtp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-05 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: net-protocol
|
@@ -38,7 +37,9 @@ files:
|
|
38
37
|
- lib/net/smtp/auth_cram_md5.rb
|
39
38
|
- lib/net/smtp/auth_login.rb
|
40
39
|
- lib/net/smtp/auth_plain.rb
|
40
|
+
- lib/net/smtp/auth_xoauth2.rb
|
41
41
|
- lib/net/smtp/authenticator.rb
|
42
|
+
- net-smtp.gemspec
|
42
43
|
homepage: https://github.com/ruby/net-smtp
|
43
44
|
licenses:
|
44
45
|
- Ruby
|
@@ -46,7 +47,6 @@ licenses:
|
|
46
47
|
metadata:
|
47
48
|
homepage_uri: https://github.com/ruby/net-smtp
|
48
49
|
source_code_uri: https://github.com/ruby/net-smtp
|
49
|
-
post_install_message:
|
50
50
|
rdoc_options: []
|
51
51
|
require_paths:
|
52
52
|
- lib
|
@@ -61,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
|
-
rubygems_version: 3.
|
65
|
-
signing_key:
|
64
|
+
rubygems_version: 3.7.0.dev
|
66
65
|
specification_version: 4
|
67
66
|
summary: Simple Mail Transfer Protocol client library for Ruby.
|
68
67
|
test_files: []
|