/offlineimap/head: changeset 280
Falls back to plain-text auth if CRAM-MD5 fails. Fixes [complete.org #42]
This commit is contained in:
parent
8392575e33
commit
b538581bf6
@ -3,6 +3,7 @@ offlineimap (3.99.3) unstable; urgency=low
|
||||
* Moved password promting into imapserver.py. Passwords are now asked
|
||||
for on-demand and typos will no longer crash the program (the user
|
||||
will be re-prompted). Closes: #162672.
|
||||
* Falls back to plain-text auth if CRAM-MD5 fails. Fixes [complete.org #42]
|
||||
|
||||
-- John Goerzen <jgoerzen@complete.org> Mon, 4 Nov 2002 11:16:11 -0600
|
||||
|
||||
|
@ -115,6 +115,12 @@ class IMAPServer:
|
||||
reply.hexdigest()
|
||||
return retval
|
||||
|
||||
def plainauth(self, imapobj):
|
||||
UIBase.getglobalui().debug('imap',
|
||||
'Attempting plain authentication')
|
||||
imapobj.login(self.username, self.getpassword())
|
||||
|
||||
|
||||
def acquireconnection(self):
|
||||
"""Fetches a connection from the pool, making sure to create a new one
|
||||
if needed, to obey the maximum connection limits, etc.
|
||||
@ -164,11 +170,12 @@ class IMAPServer:
|
||||
if 'AUTH=CRAM-MD5' in imapobj.capabilities:
|
||||
UIBase.getglobalui().debug('imap',
|
||||
'Attempting CRAM-MD5 authentication')
|
||||
try:
|
||||
imapobj.authenticate('CRAM-MD5', self.md5handler)
|
||||
except imapobj.error, val:
|
||||
self.plainauth(imapobj)
|
||||
else:
|
||||
UIBase.getglobalui().debug('imap',
|
||||
'Attempting plain authentication')
|
||||
imapobj.login(self.username, self.getpassword())
|
||||
self.plainauth(imapobj)
|
||||
# Would bail by here if there was a failure.
|
||||
success = 1
|
||||
except imapobj.error, val:
|
||||
|
Loading…
Reference in New Issue
Block a user