From b01995ddbc65372d98f1755cb063eb18669a6061 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 22 May 2017 18:33:08 +0200 Subject: use pass to get the mail passwords --- offlineimap/FAU.IMAP.PASS.gpg | Bin 610 -> 0 bytes offlineimap/MUHQ.IMAP.PASS.gpg | Bin 609 -> 0 bytes offlineimap/offlineimap.py | 4 ++++ offlineimap/offlineimaprc | 5 +++-- setup.py | 2 -- 5 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 offlineimap/FAU.IMAP.PASS.gpg delete mode 100644 offlineimap/MUHQ.IMAP.PASS.gpg create mode 100644 offlineimap/offlineimap.py diff --git a/offlineimap/FAU.IMAP.PASS.gpg b/offlineimap/FAU.IMAP.PASS.gpg deleted file mode 100644 index 3ef1318..0000000 Binary files a/offlineimap/FAU.IMAP.PASS.gpg and /dev/null differ diff --git a/offlineimap/MUHQ.IMAP.PASS.gpg b/offlineimap/MUHQ.IMAP.PASS.gpg deleted file mode 100644 index 5779c07..0000000 Binary files a/offlineimap/MUHQ.IMAP.PASS.gpg and /dev/null differ diff --git a/offlineimap/offlineimap.py b/offlineimap/offlineimap.py new file mode 100644 index 0000000..8172d4d --- /dev/null +++ b/offlineimap/offlineimap.py @@ -0,0 +1,4 @@ +from subprocess import check_output + +def get_passwd(account): + return check_output("pass email/" + account, shell=True).rstrip().split("\n")[0] diff --git a/offlineimap/offlineimaprc b/offlineimap/offlineimaprc index ea78741..3a46bd4 100644 --- a/offlineimap/offlineimaprc +++ b/offlineimap/offlineimaprc @@ -3,6 +3,7 @@ [general] accounts = FAUMail,MUHQ maxsyncaccounts = 2 +pythonfile = $DOTFILES_LOCATION/offlineimap/offlineimap.py [Account FAUMail] localrepository = LocalFAU @@ -23,7 +24,7 @@ type = IMAP remotehost = faumail.uni-erlangen.de remoteport = 993 remoteuser = aj46ezos -remotepassfile = $DOTFILES_LOCATION/decrypted/FAU.IMAP.PASS +remotepasseval = get_passwd("FAU") ssl=yes cert_fingerprint = BB9EE687E92693794C752F57C53483076DEF2755 newmail_hook = lambda: __import__("os").system("i3-nagbar -m \"new mail in FAU\" > /dev/null 2>&1 &") @@ -38,7 +39,7 @@ type = IMAP remotehost = antares.uberspace.de remoteport = 993 remoteuser = muhq -remotepassfile = $DOTFILES_LOCATION/decrypted/MUHQ.IMAP.PASS +remotepasseval = get_passwd("MUHQ") ssl=yes cert_fingerprint = B53A1586456E35E454DA3581980330903753AD3E newmail_hook = lambda: __import__("os").system("i3-nagbar -m \"new mail in MUHQ\" > /dev/null 2>&1 &") diff --git a/setup.py b/setup.py index d9887a5..2153685 100755 --- a/setup.py +++ b/setup.py @@ -124,8 +124,6 @@ targets = { "offlineimap": [offlineimap_warn, ("offlineimap/offlineimaprc", home_dir + "/.offlineimaprc"), - ("offlineimap/FAU.IMAP.PASS.gpg", ""), - ("offlineimap/MUHQ.IMAP.PASS.gpg", ""), ("offlineimap/offlineimap@.service", "/etc/systemd/system/offlineimap@" + user + ".service"), offlineimap_passwd], -- cgit v1.2.3