class Net::IMAP::SASL::PlainAuthenticator

can be secured by TLS encryption.
greater be used for all traffic, and deprecate cleartext access ASAP. PLAIN
recommends TLS version 1.2 or
cleartext authentication until after TLS has been negotiated.<br>RFC-3501 encourages servers to disable
PLAIN authentication sends the password in cleartext.<br><br>RFC-4616. See Net::IMAP#authenticate.
Authenticator for the “PLAIN” SASL mechanism, specified in

def done?; @done end

does *not* indicate success.
The authentication should not succeed unless this returns true, but it

Returns true when the initial client response was sent.
def done?; @done end

def initial_response?; true end

+PLAIN+ can send an initial client response.

initial_response? -> true
:call-seq:
def initial_response?; true end

def initialize(user = nil, pass = nil,

Any other keyword parameters are quietly ignored.

identity from the authentication identity.
When +authzid+ is not set, the server should derive the authorization

* _optional_ #authzid ― Authorization identity to act as or on behalf of.

* #password ― A password or passphrase associated with the #authcid.

#username ― An alias for #authcid.

* #authcid ― Authentication identity that is associated with #password.

==== Parameters

Called by Net::IMAP#authenticate and similar methods on other clients.

Creates an Authenticator for the "+PLAIN+" SASL mechanism.

new(authcid:, password:, authzid: nil, **) -> authenticator
new(username:, password:, authzid: nil, **) -> authenticator
new(username, password, authzid: nil, **) -> authenticator
:call-seq:
def initialize(user = nil, pass = nil,
               authcid: nil, secret: nil,
               username: nil, password: nil, authzid: nil, **)
  username ||= authcid || user or
    raise ArgumentError, "missing username (authcid)"
  password ||= secret || pass or raise ArgumentError, "missing password"
  raise ArgumentError, "username contains NULL" if username.include?(NULL)
  raise ArgumentError, "password contains NULL" if password.include?(NULL)
  raise ArgumentError, "authzid contains NULL"  if authzid&.include?(NULL)
  @username = username
  @password = password
  @authzid  = authzid
  @done = false
end

def process(data)

Responds with the client's credentials.
def process(data)
  return "#@authzid\0#@username\0#@password"
ensure
  @done = true
end