lib/net/smtp.rb in net-smtp-0.3.1.1 vs lib/net/smtp.rb in net-smtp-0.3.2
- old
+ new
@@ -33,12 +33,17 @@
# In later release, this module becomes a class.
attr_reader :response
def initialize(response, message: nil)
- @response = response
- @message = message
+ if response.is_a?(::Net::SMTP::Response)
+ @response = response
+ @message = message
+ else
+ @response = nil
+ @message = message || response
+ end
end
def message
@message || response.message
end
@@ -177,11 +182,11 @@
# # CRAM MD5
# Net::SMTP.start('your.smtp.server', 25
# user: 'Your Account', secret: 'Your Password', authtype: :cram_md5)
#
class SMTP < Protocol
- VERSION = "0.3.1.1"
+ VERSION = "0.3.2"
Revision = %q$Revision$.split[1]
# The default SMTP port number, 25.
def SMTP.default_port
@@ -641,11 +646,11 @@
@socket = new_internet_message_io(tls? ? tlsconnect(s, @ssl_context_tls) : s)
check_response critical { recv_response() }
do_helo helo_domain
if ! tls? and (starttls_always? or (capable_starttls? and starttls_auto?))
unless capable_starttls?
- raise SMTPUnsupportedCommand.new(nil, message: "STARTTLS is not supported on this server")
+ raise SMTPUnsupportedCommand, "STARTTLS is not supported on this server"
end
starttls
@socket = new_internet_message_io(tlsconnect(s, @ssl_context_starttls))
# helo response may be different after STARTTLS
do_helo helo_domain
@@ -1163,10 +1168,10 @@
# Address with parametres for MAIL or RCPT command
class Address
# mail address [String]
attr_reader :address
- # paramters [Array<String>]
+ # parameters [Array<String>]
attr_reader :parameters
# :call-seq:
# initialize(address, parameter, ...)
#