'Implements SASL PLAIN authentication, RFC 4616,
http://tools.ietf.org/html/rfc4616'

def __plainhandler(self, response):

    authc = self.username
    passwd = self.__getpassword()
    authz = ''
    if (self.user_identity != None):
        authz = self.user_identity
    NULL = '\x00'
    retval = NULL.join((authz, authc, passwd))
    logsafe_retval = NULL.join((authz, authc, '(passwd    hidden    for    log)'))
    self.ui.debug('imap', ('__plainhandler:    returning    %s' % logsafe_retval))
    return retval
