when the smtp server auth with 'username', the smtp.py client will thow exception
[email protected] Tue, 13 Oct 2009 02:18:43 -0000
| Newsgroups | gmane.comp.python.twisted.bugs |
|---|---|
| Message-ID | <[email protected]> |
New submission from itfront <None>:
when I use the smtp.py to send email,I got exception:
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/context.py", line 37, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/internet/pollreactor.py", line 186, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/internet/tcp.py", line 463, in doRead
return self.protocol.dataReceived(data)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/protocols/basic.py", line 231, in dataReceived
why = self.lineReceived(line)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/mail/smtp.py", line 1052, in lineReceived
/13823106429
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/context.py", line 37, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/internet/pollreactor.py", line 186, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/internet/tcp.py", line 463, in doRead
return self.protocol.dataReceived(data)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/protocols/basic.py", line 231, in dataReceived
why = self.lineReceived(line)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/mail/smtp.py", line 1052, in lineReceived
why = self._okresponse(self.code,'\n'.join(self.resp))
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/mail/smtp.py", line 1372, in esmtpState_challenge
self._authResponse(auth, resp)
File "/usr/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/mail/smtp.py", line 1388, in _authResponse
self.sendLine(encode_base64(resp, e
------------------------------------------------
finally , I find out that , at about line 1379:
def _authResponse(self, auth, challenge):
self._failresponse = self.esmtpAUTHDeclined
try:
challenge = base64.decodestring(challenge)
challenge = challenge.capitalize() #add this!!
----------
Type : defect
Component: core
Keywords :
Priority : high
Nosy :
----------
http://twistedmatrix.com/trac/ticket/4055