Skip to content

Commit

Permalink
Merge pull request #62 from ruby/v0-4-0
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
tmtm authored Sep 20, 2023
2 parents 531c797 + d2e381f commit bf27727
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
21 changes: 18 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# NEWS

## Version 0.4.0
## Version 0.4.0 (2023-09-20)

* add Net::SMTP::Authenticator class and auth_* methods are separated from the Net::SMTP class. <https://github.com/ruby/net-smtp/pull/53/files>
### Improvements

* add Net::SMTP::Authenticator class and auth_* methods are separated from the Net::SMTP class. <https://github.com/ruby/net-smtp/pull/53>
This allows you to add a new authentication method to Net::SMTP.
Create a class with an `auth` method that inherits Net::SMTP::Authenticator.
The `auth` method has two arguments, `user` and `secret`.
Send an instruction to the SMTP server by using the `continue` or `finish` method.
For more information, see lib/net/smtp/auto _*.rb.
* Add SMTPUTF8 support <https://github.com/ruby/net-smtp/pull/49>

### Fixes

* Revert "Replace Timeout.timeout with socket timeout" <https://github.com/ruby/net-smtp/pull/51>
* Fixed issue sending emails to unaffected recipients on 53x error <https://github.com/ruby/net-smtp/pull/56>

### Others

* Add SMTPUTF8 support <https://github.com/ruby/net-smtp/pull/49>
* Removed unnecessary Subversion keywords <https://github.com/ruby/net-smtp/pull/57>

## Version 0.3.3 (2022-10-29)

Expand Down
14 changes: 5 additions & 9 deletions lib/net/smtp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# = net/smtp.rb
#
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
Expand All @@ -22,7 +23,6 @@
end

module Net

# Module mixed in to all SMTP error classes
module SMTPError
# This *class* is a module for backward compatibility.
Expand All @@ -36,7 +36,7 @@ def initialize(response, message: nil)
@message = message
else
@response = nil
@message = message || response
@message = message || response
end
end

Expand Down Expand Up @@ -187,7 +187,7 @@ class SMTPUnsupportedCommand < ProtocolError
# user: 'Your Account', secret: 'Your Password', authtype: :cram_md5)
#
class SMTP < Protocol
VERSION = "0.3.3"
VERSION = "0.4.0"

# The default SMTP port number, 25.
def SMTP.default_port
Expand All @@ -210,7 +210,7 @@ class << self

def SMTP.default_ssl_context(ssl_context_params = nil)
context = OpenSSL::SSL::SSLContext.new
context.set_params(ssl_context_params ? ssl_context_params : {})
context.set_params(ssl_context_params || {})
context
end

Expand Down Expand Up @@ -281,7 +281,7 @@ def inspect
attr_accessor :esmtp

# +true+ if the SMTP object uses ESMTP (which it does by default).
alias :esmtp? :esmtp
alias esmtp? esmtp

# true if server advertises STARTTLS.
# You cannot get valid value before opening SMTP session.
Expand Down Expand Up @@ -829,8 +829,6 @@ def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream
# Authentication
#

public

DEFAULT_AUTH_TYPE = :plain

def authenticate(user, secret, authtype = DEFAULT_AUTH_TYPE)
Expand Down Expand Up @@ -1130,11 +1128,9 @@ def to_s
@address
end
end

end # class SMTP

SMTPSession = SMTP # :nodoc:

end

require_relative 'smtp/authenticator'
Expand Down
6 changes: 1 addition & 5 deletions net-smtp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ Gem::Specification.new do |spec|
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage

spec.files = %w[
LICENSE.txt
lib/net/smtp.rb
net-smtp.gemspec
]
spec.files = `git ls-files README.md NEWS.md LICENSE.txt lib`.split
spec.require_paths = ["lib"]

spec.add_dependency "net-protocol"
Expand Down

0 comments on commit bf27727

Please sign in to comment.