'Authenticate with the server using a username and password
This command is allowed in the Non-Authenticated state.  If the
server supports the STARTTLS capability and our transport supports
TLS, TLS is negotiated before the login command is issued.
A more secure way to log in is to use C{startTLS} or
C{authenticate} or both.
@type username: L{str}
@param username: The username to log in with
@type password: L{str}
@param password: The password to log in with
@rtype: C{Deferred}
@return: A deferred whose callback is invoked if login is successful
and whose errback is invoked otherwise.'

def login(self, username, password):

    d = maybeDeferred(self.getCapabilities)
    d.addCallback(self.__cbLoginCaps, username, password)
    return d
