Problems with threading and gssapi authentication

Scott Henson sjh at foolishpride.org
Sun May 29 02:04:40 UTC 2011


I've recently started having problems using offlineimap to synchronize my
mail. I'm running against a zimbra server and using gssapi authentication.
When I set the max connection count to 1, things work as expected. However,
any number above 1 produces some very weird errors.

On 6.2.0, I would get strange exceptions about None Type not having a
method. On 6.3.3, I get prompted for my password a few times, and then
offlineimap seems to hang doing nothing.

I just tested v6.3.4-rc1 and I get prompted for the password a few times (my
max connections are set to 5, sometimes I get prompted 4 times, sometimes
less, but never more than 4 times). Depending on the number of times I get
prompted, I will start syncing some email. Four password prompts result in
no emai transferred. Three or less results in some email getting across.
Either way, eventually something like the following appears.

"""
Copy message 1711582 from INBOX:
 Copy message 1711582 IMAP[INBOX] -> Maildir[INBOX]
 Establishing connection to mail.corp.redhat.com:993.
 Thread 'Copy message 1711470 from INBOX' terminated with exception:
Traceback (most recent call last):
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/threadutil.py",
line 139, in run
    Thread.run(self)
  File "/usr/lib64/python2.7/threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/folder/Base.py",
line 250, in copymessageto
    message = self.getmessage(uid)
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/folder/IMAP.py",
line 202, in getmessage
    imapobj = self.imapserver.acquireconnection()
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imapserver.py",
line 238, in acquireconnection
    self.plainauth(imapobj)
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imapserver.py",
line 127, in plainauth
    imapobj.login(self.username, self.getpassword())
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imaplib2.py",
line 779, in login
    typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imaplib2.py",
line 1492, in _simple_command
    return self._command_complete(self._command(name, *args), kw)
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imaplib2.py",
line 1269, in _command_complete
    self._check_bye()
  File "/home/shenson/Code/Projects/offlineimap/offlineimap/imaplib2.py",
line 1138, in _check_bye
    raise self.abort(bye[-1])
abort: Zimbra IMAP server terminating connection


Last 6 debug messages logged for Copy message 1711470 from INBOX prior to
exception:
thread: Register new thread 'Copy message 1711470 from INBOX' (account
'Work')
imap: Attempting GSSAPI authentication
imap: A required input parameter could not be read: Unknown error
imap:   13:19.40 Copy message 1711470 from INBOX last 20 log messages:
imap: GSSAPI Authentication failed
imap: Attempting plain authentication
"""

I checked on the server side and I see that zimbra logs one good connection
from my host, followed by four connections where the authentication failed.
In each case where the authentication failed, zimbra got empty passwords.

I inserted some debugging statements into the code around the
gssapi authentication handler. From what I can tell, the first thread will
always get its connection authenticated. Then subsequent threads get some
form of the following back in imapserver.IMAPServer.acquireconnection from
the imapobj.error in the gssapi section.

AUTHENTICATE command error: BAD ['AUTHENTICATE aborted']. Data: XXXXX
AUTHENTICATE GSSAPI

I'm still digging around, but it seems to me to be a threading and state
issue with kerberos. Can anyone point me in the right direction to fixing
this? Thanks.

-- 
Scott Henson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20110528/37717001/attachment.html>


More information about the OfflineIMAP-project mailing list