def _authResponse(self, auth, challenge):
self._failresponse = self.esmtpAUTHDeclined
try:
challenge = base64.decodestring(challenge)
except binascii.Error, e:
# Illegal challenge, give up, then quit
self.sendLine('*')
self._okresponse = self.esmtpAUTHMalformedChallenge
self._failresponse = self.esmtpAUTHMalformedChallenge
else:
resp = auth.challengeResponse(self.secret, challenge)
self._expected = [235]
self._okresponse = self.smtpState_from
self.sendLine(encode_base64(resp, eol=""))
if auth.getName() == "LOGIN" and challenge == "Username:":
self._expected = [334]
self._authinfo = auth
self._okresponse = self.esmtpState_challenge
评论列表
文章目录