diff --git a/NEWS.md b/NEWS.md index 4638fac..63a324b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. +### Improvements + +* add Net::SMTP::Authenticator class and auth_* methods are separated from the Net::SMTP class. + 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 + +### Fixes + +* Revert "Replace Timeout.timeout with socket timeout" +* Fixed issue sending emails to unaffected recipients on 53x error + +### Others -* Add SMTPUTF8 support +* Removed unnecessary Subversion keywords ## Version 0.3.3 (2022-10-29) diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 46f2314..6ceb61b 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # = net/smtp.rb # # Copyright (c) 1999-2007 Yukihiro Matsumoto. @@ -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. @@ -36,7 +36,7 @@ def initialize(response, message: nil) @message = message else @response = nil - @message = message || response + @message = message || response end end @@ -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 @@ -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 @@ -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. @@ -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) @@ -1130,11 +1128,9 @@ def to_s @address end end - end # class SMTP SMTPSession = SMTP # :nodoc: - end require_relative 'smtp/authenticator' diff --git a/net-smtp.gemspec b/net-smtp.gemspec index efc9b60..b19844f 100644 --- a/net-smtp.gemspec +++ b/net-smtp.gemspec @@ -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"