]> code.delx.au - offlineimap/commitdiff
Apply patch to fix autorefresh with Kerberos
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 21 Apr 2009 05:03:28 +0000 (00:03 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 21 Apr 2009 05:03:28 +0000 (00:03 -0500)
Patch from Eric Dorland

Closes: #470875
From: Wouter Verhelst
Subject: kerberos authentication works only the first time
Date: Fri, 14 Mar 2008 09:28:37 +0100

Package: offlineimap
Version: 5.99.8
Severity: normal

Hi,

I have the "autorefresh" configuration option specified in my
.offlineimaprc, and am now using the kerberos authentication.

However, this kerberos authentication seems to work only the first
time
offlineimap tries to fetch mails. The next time, it fails with this
output:

Thread 'Account sync Test' terminated with exception:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/offlineimap/threadutil.py",
  line 153, in run
    Thread.run(self)
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/var/lib/python-support/python2.4/offlineimap/accounts.py",
  line 119, in syncrunner
    self.sync()
  File "/var/lib/python-support/python2.4/offlineimap/accounts.py",
  line 148, in sync
    remoterepos.syncfoldersto(localrepos, [statusrepos])
  File
  "/var/lib/python-support/python2.4/offlineimap/repository/Base.py",
  line 135, in syncfoldersto
    srcfolders = src.getfolders()
  File
  "/var/lib/python-support/python2.4/offlineimap/repository/IMAP.py",
  line 192, in getfolders
    listresult = imapobj.list(directory =
    self.imapserver.reference)[1]
  File "/usr/lib/python2.4/imaplib.py", line 469, in list
    typ, dat = self._simple_command(name, directory, pattern)
  File "/usr/lib/python2.4/imaplib.py", line 1028, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.4/imaplib.py", line 787, in _command
    raise self.error(
error: command LIST illegal in state NONAUTH

offlineimap/imapserver.py

index c850e99a01fc3963f8becdecea8dea783bbd004d..2658e74e1106db2ca61d53311f54e599bd0d069f 100644 (file)
@@ -334,6 +334,10 @@ class IMAPServer:
         self.assignedconnections = []
         self.availableconnections = []
         self.lastowner = {}
+        # reset kerberos state
+        self.gss_step = self.GSS_STATE_STEP
+        self.gss_vc = None
+        self.gssapi = False
         self.connectionlock.release()
 
     def keepalive(self, timeout, event):