From beed39afb3d3dfe5a89e3a4dc668ae2e1459dd23 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 14 Oct 2019 00:42:09 -0400 Subject: [PATCH] offlineimap: add minimal config Heavily inspired by the offlineimap Arch Wiki page as well as the minimal example that ships with the package. I'm toying around with local Maildir's for my personal email. As I subscribe to more mailing lists, it really is a better way to improve MUA speed / snappiness. I also like the idea of owning the hardcopies of my emails should I ever need them. --- .dotfiler.json | 3 ++- .gitignore | 4 ++++ offlineimap/config | 19 +++++++++++++++++++ offlineimap/get_pass.py | 12 ++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 offlineimap/config create mode 100755 offlineimap/get_pass.py diff --git a/.dotfiler.json b/.dotfiler.json index 9c23f00..f8e7c70 100644 --- a/.dotfiler.json +++ b/.dotfiler.json @@ -12,7 +12,8 @@ "alacritty", "mutt", "nvim", - "git" + "git", + "offlineimap" ], "SKIP_FILES": [ "cpanfile", diff --git a/.gitignore b/.gitignore index bd47c7c..e79d733 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ vim/.* Vagrantfile *.log .vagrant + +# Compiled python files +*.pyc +__pycache__ diff --git a/offlineimap/config b/offlineimap/config new file mode 100644 index 0000000..345e519 --- /dev/null +++ b/offlineimap/config @@ -0,0 +1,19 @@ +[general] +accounts = karleco +pythonfile = ~/.config/offlineimap/get_pass.py + +[Account karleco] +localrepository = karleco-local +remoterepository = karleco-remote + +[Repository karleco-local] +type = Maildir +localfolders = ~/mail + +[Repository karleco-remote] +type = IMAP +remotehost = imap.fastmail.com +remoteuser = alex@karle.co +expunge = no +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +remotepasseval = get_pass() diff --git a/offlineimap/get_pass.py b/offlineimap/get_pass.py new file mode 100755 index 0000000..caf95d8 --- /dev/null +++ b/offlineimap/get_pass.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python2 +# Small python script to retrieve encrypted gpg email password +# Heavily inspired by Arch Wiki's offlineimap docs +from subprocess import check_output + +def get_pass(): + return check_output("gpg -dq ~/.config/mutt/accounts/karleco.gpg", shell=True).strip("\n") + +# If called via CLI, output the password to STDOUT +# Useful for things like GIT_ASKPASS +if __name__ == "__main__": + print(get_pass()) -- libgit2 0.28.4