From 946b7425dec6b3a97abdd631f1c00f7f4ca79a4f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 14 Aug 2019 23:45:13 -0700 Subject: Fix (automatic) syncing of email - Load the necessary environment variables from ‘gnome-keyring-daemon’ when loading fish. - Don’t sync the Archive directory from ryuslash.org, it’s too big and mbsync seems to get really confused about it. - Disable old email accounts from syncing with mbsync. - Fix the ‘get-mail-password’ and ‘set-mail-password’ scripts. - Use ‘secretstorage’ instead of ‘keyring’, this appears to be newer and easier to use. --- mbsync/usr/bin/get-mail-password | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'mbsync/usr/bin/get-mail-password') diff --git a/mbsync/usr/bin/get-mail-password b/mbsync/usr/bin/get-mail-password index 02f4033..ecfbb09 100755 --- a/mbsync/usr/bin/get-mail-password +++ b/mbsync/usr/bin/get-mail-password @@ -1,15 +1,12 @@ #!/usr/bin/python3 -import gi - -gi.require_version('GnomeKeyring', '1.0') - -import logging - -logger = logging.getLogger('keyring') -logger.addHandler(logging.StreamHandler()) - -import keyring import sys +import secretstorage + +connection = secretstorage.dbus_init() +collection = secretstorage.get_collection_by_alias(connection, "login") -print(keyring.get_password('offlineimap', sys.argv[1])) +for foo in collection.search_items( + {"application": "mbsync", "account": sys.argv[1]} +): + print(foo.get_secret().decode()) -- cgit v1.3-2-g0d8e