class Minbox::AuthLogin

Public Instance Methods

run(client, line) click to toggle source
# File lib/minbox/client.rb, line 72
def run(client, line)
  username = line.gsub!(/AUTH LOGIN ?/i, '')
  if username.strip == ''
    client.write '334 VXNlcm5hbWU6'
    username = client.read
  end
  client.write '334 UGFzc3dvcmQ6'
  password = Base64.decode64(client.read)
  client.authenticate(username, password)
end