Class: Minbox::AuthLogin

Inherits:
Object
  • Object
show all
Defined in:
lib/minbox/client.rb

Instance Method Summary collapse

Instance Method Details

#run(client, line) ⇒ Object



72
73
74
75
76
77
78
79
80
81
# 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