class Net::IMAP::SASL::LoginAuthenticator

for both specification and deprecation.
compatibility with existing servers. See
marks “LOGIN” as obsoleted in favor of “PLAIN”. It is included here for
registry}[www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
The {SASL mechanisms
== Deprecated
can be secured by TLS encryption.
greater be used for all traffic, and deprecate cleartext access ASAP. LOGIN
recommends TLS version 1.2 or
cleartext authentication until after TLS has been negotiated.<br>RFC3501 encourages servers to disable
LOGIN authentication sends the password in cleartext.
Authenticator for the “LOGIN” SASL mechanism. See Net::IMAP#authenticate.

def done?; @state == STATE_DONE end

def done?; @state == STATE_DONE end

def initial_response?; false end

def initial_response?; false end

def initialize(user = nil, pass = nil,

def initialize(user = nil, pass = nil,
               authcid: nil, username: nil,
               password: nil, secret: nil,
               warn_deprecation: true,
               **)
  if warn_deprecation
    warn "WARNING: LOGIN SASL mechanism is deprecated. Use PLAIN instead."
  end
  @user = authcid || username || user
  @password = password || secret || pass
  @state = STATE_USER
end

def process(data)

def process(data)
  case @state
  when STATE_USER
    @state = STATE_PASSWORD
    return @user
  when STATE_PASSWORD
    @state = STATE_DONE
    return @password
  when STATE_DONE
    raise ResponseParseError, data
  end
end