Re: [Geary] how Geary stores the password in the gnome keyring



Thanks Jim, it works!

Il mer, mar 5, 2014 at 11:42 , Jim Nelson <jim yorba org> ha scritto:
Ah.  The difference is that Geary uses only one key-value pair to reference the password in the keyring while Evolution uses three.

Here's a modified version of the script:

import sys
import gobject
import gnomekeyring


try:
    user = sys.argv[1]
except ValueError as e:
    print 'Error parsing arguments: %s' % (e,)
    print 'Usage: %s USERNAME' % (sys.argv[0],)
    sys.exit(1)

gobject.set_application_name('Mutt')

try:
    keys = gnomekeyring.find_network_password_sync("org.yorba.geary imap_username:" + user)
    password = keys[0]["password"].replace('"', r'\"')
    print 'set imap_pass = "%s"' % (password,)
except (gnomekeyring.NoMatchError, gnomekeyring.IOError), e:
    pass

Change "imap_username" to "smtp_username" to fetch the SMTP password.

I make no guarantee that this is the most Pythonic of solutions.

-- Jim

On Wed, Mar 5, 2014 at 1:25 PM, Federico Bruni <fede inventati org> wrote:
No, I'm asking why the script below can't access the password stored by Geary on Gnome keyring, while it can access the password stored by Evolution (I didn't test Evolution, I'm just reporting what I've been told).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]