From 165c704161a6ecd3c2c084f4e8fb5a466b530b72 Mon Sep 17 00:00:00 2001 From: TOMITA Masahiro Date: Mon, 18 Sep 2023 16:34:11 +0900 Subject: [PATCH 1/2] chore --- lib/net/smtp.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 46f2314..ecf986f 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 @@ -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' From d2e381f2416e19182e61f7b5029210ac21c656e2 Mon Sep 17 00:00:00 2001 From: TOMITA Masahiro Date: Wed, 20 Sep 2023 22:54:28 +0900 Subject: [PATCH 2/2] v0.4.0 --- NEWS.md | 21 ++++++++++++++++++--- lib/net/smtp.rb | 2 +- net-smtp.gemspec | 6 +----- 3 files changed, 20 insertions(+), 9 deletions(-) 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 ecf986f..6ceb61b 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -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 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"