dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit beed39afb3d3dfe5a89e3a4dc668ae2e1459dd23 (patch)
parent e5df531efd9842476ee08aaa03ba80ee58d6cfcf
Author: Alex Karle <alex@karle.co>
Date:   Mon, 14 Oct 2019 00:42:09 -0400

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.

Diffstat:
M.dotfiler.json | 3++-
M.gitignore | 4++++
Aofflineimap/config | 19+++++++++++++++++++
Aofflineimap/get_pass.py | 12++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)

diff --git 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 @@ -13,3 +13,7 @@ vim/.* Vagrantfile *.log .vagrant + +# Compiled python files +*.pyc +__pycache__ diff --git a/offlineimap/config 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 @@ -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())