Permalink
Browse files

Bugfix patch for offlineimap

Hello John,

i fixed some tiny bugs in offlineimap, mainly just for myself. They are
more dirty fixes than real bugfixes since I'm missing the deeper insight
into the code.
Especially the first one for Curses.py is very dirty and breaks the
scaling of the interface when the terminal size changes, but at least
the terminal is in proper state after exiting offlineimap.

In the order of appearance in the patchfile:
1. 'fixes' terminal breakage on quit of curses interface in python 2.6
to 2.6.5 (fixed since 2.6.6 http://bugs.python.org/issue7567)
2. fixes netrc password authentication
3. fixes user name querying from netrc

The patch is made for git revision 6b1cb5e

Thanks a lot for the great application!

Best regards,
buergi
  • Loading branch information...
1 parent 6b1cb5e commit 9239a2d3268e155d13c972808ea7d07dca87d0ce buergi committed with Aug 19, 2010
Showing with 6 additions and 4 deletions.
  1. +2 −2 offlineimap/imapserver.py
  2. +2 −2 offlineimap/repository/IMAP.py
  3. +2 −0 offlineimap/ui/Curses.py
@@ -176,15 +176,15 @@ def md5handler(self, response):
challenge = response.strip()
ui.debug('imap', 'md5handler: got challenge %s' % challenge)
- passwd = self.getpassword()
+ passwd = self.repos.getpassword()
retval = self.username + ' ' + hmac.new(passwd, challenge).hexdigest()
ui.debug('imap', 'md5handler: returning %s' % retval)
return retval
def plainauth(self, imapobj):
UIBase.getglobalui().debug('imap',
'Attempting plain authentication')
- imapobj.login(self.username, self.getpassword())
+ imapobj.login(self.username, self.repos.getpassword())
def gssauth(self, response):
data = base64.b64encode(response)
@@ -109,7 +109,7 @@ def getuser(self):
return user
try:
- netrcentry = netrc.netrc().authentificator(self.gethost())
+ netrcentry = netrc.netrc().authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
@@ -118,7 +118,7 @@ def getuser(self):
return netrcentry[0]
try:
- netrcentry = netrc.netrc('/etc/netrc').authentificator(self.gethost())
+ netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
@@ -122,6 +122,8 @@ def stop(self):
del self.stdscr
def reset(self):
+ # dirty walkaround for bug http://bugs.python.org/issue7567 in python 2.6 to 2.6.5 (fixed since #83743)
+ if (sys.version_info[0:3] >= (2,6) and sys.version_info[0:3] <= (2,6,5)): return
self.stop()
self.start()

0 comments on commit 9239a2d

Please sign in to comment.