self.username = username
self.password = password
self.passworderror = None
+ self.goodpassword = None
self.hostname = hostname
self.tunnel = tunnel
self.port = port
self.reference = reference
def getpassword(self):
+ if self.goodpassword != None:
+ return self.goodpassword
+
if self.password != None and self.passworderror == None:
return self.password
self.plainauth(imapobj)
# Would bail by here if there was a failure.
success = 1
+ self.goodpassword = self.password
except imapobj.error, val:
self.passworderror = str(val)
self.password = None
# Base repository support
-# Copyright (C) 2002, 2003, 2006 John Goerzen
+# Copyright (C) 2002-2007 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
return self.restore_folder_atimes()
+ def connect(self):
+ """Establish a connection to the remote, if necessary. This exists
+ so that IMAP connections can all be established up front, gathering
+ passwords as needed. It was added in order to support the
+ error recovery -- we need to connect first outside of the error
+ trap in order to validate the password, and that's the point of
+ this function."""
+ pass
+
def holdordropconnections(self):
pass