tags 470875 patch
thanks

I think this should do the trick. Sorry for the delay.

* Eric Dorland ([EMAIL PROTECTED]) wrote:
> * John Goerzen ([EMAIL PROTECTED]) wrote:
> > Eric,
> > 
> > Would you be able to investigate this?
> 
> So one work around is to use 'holdconnectionopen'. I'm guessing the
> kerberos state is getting screwed up on connection close. Let me look
> around. 
> 
> Content-Description: Wouter Verhelst <[EMAIL PROTECTED]>: Bug#470875: 
> kerberos authentication works only the first time
> > Date: Fri, 14 Mar 2008 09:28:37 +0100
> > From: Wouter Verhelst <[EMAIL PROTECTED]>
> > X-Mailer: reportbug 3.39
> > To: Debian Bug Tracking System <[EMAIL PROTECTED]>
> > Reply-To: Wouter Verhelst <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> > Subject: Bug#470875: kerberos authentication works only the first time
> > X-Spam-Checker-Version: SpamAssassin 3.1.4-bugs.debian.org_2005_01_02 
> >     (2006-07-26) on rietz.debian.org
> > X-Spam-Level: 
> > X-Spam-Status: No, score=-11.8 required=4.0 tests=BAYES_00,FORGED_RCVD_HELO,
> >     FOURLA,FROMDEVELOPER,HAS_PACKAGE autolearn=no 
> >     version=3.1.4-bugs.debian.org_2005_01_02
> > X-Spam-Status: No (score 0.0): AWL=-0.001, UNPARSEABLE_RELAY=0.001
> > 
> > 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
> > 
> > Last 50 debug messages logged for Account sync Test prior to exception:
> > maildir:   This is a maildir folder.
> > maildir:   foldername = jokes
> > maildir: _GETFOLDERS_SCANDIR STARTING. root = /home/wouter/Maildir, 
> > extension = jokes
> > maildir:   toppath = /home/wouter/Maildir/jokes
> > maildir:   *** top of loop
> > maildir:   dirname = cur
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = new
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = tmp
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = .
> > maildir:   fullname = /home/wouter/Maildir/jokes/.
> > maildir:   This is a maildir folder.
> > maildir:   foldername = jokes/.
> > maildir: _GETFOLDERS_SCANDIR RETURNING ['jokes/.']
> > maildir:   *** top of loop
> > maildir:   dirname = nbd
> > maildir:   fullname = /home/wouter/Maildir/nbd
> > maildir:   This is a maildir folder.
> > maildir:   foldername = nbd
> > maildir: _GETFOLDERS_SCANDIR STARTING. root = /home/wouter/Maildir, 
> > extension = nbd
> > maildir:   toppath = /home/wouter/Maildir/nbd
> > maildir:   *** top of loop
> > maildir:   dirname = cur
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = new
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = tmp
> > maildir:   skipping this dir (Maildir special)
> > maildir:   *** top of loop
> > maildir:   dirname = .
> > maildir:   fullname = /home/wouter/Maildir/nbd/.
> > maildir:   This is a maildir folder.
> > maildir:   foldername = nbd/.
> > maildir: _GETFOLDERS_SCANDIR RETURNING ['nbd/.']
> > maildir:   *** top of loop
> > maildir:   dirname = .
> > maildir:   fullname = /home/wouter/Maildir/.
> > maildir:   This is a maildir folder.
> > maildir:   foldername = .
> > maildir: _GETFOLDERS_SCANDIR RETURNING ['+planet', '+planet/.', 'cronjobs', 
> > 'cro
> > [...]
> > imap: Attempting GSSAPI authentication
> > imap: A required input parameter could not be read: No error
> > imap: GSSAPI Authentication failed
> > 
> > -- System Information:
> > Debian Release: lenny/sid
> >   APT prefers unstable
> >   APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
> > 'experimental')
> > Architecture: powerpc (ppc)
> > 
> > Kernel: Linux 2.6.24-1-powerpc
> > Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
> > Shell: /bin/sh linked to /bin/bash
> > 
> > Versions of packages offlineimap depends on:
> > ii  python                        2.4.4-6    An interactive high-level 
> > object-o
> > ii  python-support                0.7.6      automated rebuilding support 
> > for p
> > 
> > offlineimap recommends no packages.
> > 
> > -- no debconf information
> > 
> > 
> > 
> 
> 



-- 
Eric Dorland <[EMAIL PROTECTED]>
ICQ: #61138586, Jabber: [EMAIL PROTECTED]

diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
index 4c89cca..003b207 100644
--- a/offlineimap/imapserver.py
+++ b/offlineimap/imapserver.py
@@ -297,6 +297,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):

Attachment: signature.asc
Description: Digital signature

Reply via email to