Colors of Noise

agx@sigxcpu.org

offlineimap and krb5-auth-dialog
15th June 2009

It turns out patching offlineimap to use it with krb5-auth-dialog's DBUS interface is not necessary. You can simply use:

import dbus
import sys

bus = dbus.SessionBus()
ka = bus.get_object('org.gnome.KrbAuthDialog',
            '/org/gnome/KrbAuthDialog')
ret = ka.acquireTgt("", dbus_interface='org.gnome.KrbAuthDialog')
if not ret:
    print >>sys.stderr, "Cannot acuire TGT, aborting."
    sys.exit (0)

as ~/.acquiretgt and add:

[general]
pythonfile=~/.acquiretgt.py

to ~/.offlineimaprc. This way on each offlineimap invocation it'll check for a valid TGT and invoke krb5-auth-dialog via DBus if none is found. Oh, and version 0.11 has also been released.

Tags: single-sign-on.

RSS feed