This class represents a response received by the SMTP
server. Instances of this class are created by the SMTP
class; they should not be directly created by the user. For more information on SMTP
responses, view Section 4.2 of RFC 5321
The three digit reply code of the SMTP
response
The human readable reply text of the SMTP
response
# File lib/net/smtp.rb, line 1038 def initialize(status, string) @status = status @string = string end
Creates a new instance of the Response
class and sets the status and string attributes
# File lib/net/smtp.rb, line 1081 def capabilities return {} unless @string[3, 1] == '-' h = {} @string.lines.drop(1).each do |line| k, *v = line[4..-1].split(' ') h[k] = v end h end
Returns a hash of the human readable reply text in the response if it is multiple lines. It does not return the first line. The key of the hash is the first word the value of the hash is an array with each word thereafter being a value in the array
Creates a CRAM-MD5 challenge. You can view more information on CRAM-MD5 on Wikipedia: en.wikipedia.org/wiki/CRAM-MD5
# File lib/net/smtp.rb, line 1093 def exception_class case @status when /\A4/ then SMTPServerBusy when /\A50/ then SMTPSyntaxError when /\A53/ then SMTPAuthenticationError when /\A5/ then SMTPFatalError else SMTPUnknownError end end
Determines whether there was an error and raises the appropriate error based on the reply code of the response
Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.