lib/net/imap/sasl/cram_md5_authenticator.rb in net-imap-0.4.1 vs lib/net/imap/sasl/cram_md5_authenticator.rb in net-imap-0.4.2

- old
+ new

@@ -12,16 +12,20 @@ # # Additionally, RFC8314[https://tools.ietf.org/html/rfc8314] discourage the use # of cleartext and recommends TLS version 1.2 or greater be used for all # traffic. With TLS +CRAM-MD5+ is okay, but so is +PLAIN+ class Net::IMAP::SASL::CramMD5Authenticator - def initialize(user, password, warn_deprecation: true, **_ignored) + def initialize(user = nil, pass = nil, + authcid: nil, username: nil, + password: nil, secret: nil, + warn_deprecation: true, + **) if warn_deprecation warn "WARNING: CRAM-MD5 mechanism is deprecated." # TODO: recommend SCRAM end require "digest/md5" - @user = user - @password = password + @user = authcid || username || user + @password = password || secret || pass @done = false end def initial_response?; false end