# File lib/em/protocols/smtpserver.rb, line 259
259:       def process_auth str
260:         if @state.include?(:auth)
261:           send_data "503 auth already issued\r\n"
262:         elsif str =~ /\APLAIN\s+/i
263:           plain = ($'.dup).unpack("m").first # Base64::decode64($'.dup)
264:           discard,user,psw = plain.split("\000")
265:           if receive_plain_auth user,psw
266:             send_data "235 authentication ok\r\n"
267:             @state << :auth
268:           else
269:             send_data "535 invalid authentication\r\n"
270:           end
271:           #elsif str =~ /\ALOGIN\s+/i
272:         else
273:           send_data "504 auth mechanism not available\r\n"
274:         end
275:       end