summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-04-19 19:23:25 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-04-19 19:23:25 +0100
commite5b50746586ef6204d7cb237d7889972b47863e1 (patch)
tree4cf7c829586bf469d49762f28e95a4861b03cad1
parent8ba8a330fb7201ae744b673b3103e950fef78563 (diff)
added encryption to offlineimap passwords
-rwxr-xr-xmake2
-rw-r--r--offlineimap.py12
2 files changed, 13 insertions, 1 deletions
diff --git a/make b/make
index 1e2a73b..c1a9bbe 100755
--- a/make
+++ b/make
@@ -4,7 +4,7 @@ dir=~/dotfiles
olddir=~/dotfiles_old
# Files to sync
-files="vim mutt vifm bashrc zshrc xmodmap mynotes tmux.conf zathurarc offlineimaprc inputrc latexmkrc crontab gitconfig"
+files="vim mutt passwords vifm bashrc zshrc xmodmap mynotes tmux.conf zathurarc offlineimaprc offlineimap.py inputrc latexmkrc crontab gitconfig"
rm -rf $olddir
mkdir -p $olddir
diff --git a/offlineimap.py b/offlineimap.py
new file mode 100644
index 0000000..c63b82d
--- /dev/null
+++ b/offlineimap.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+import os
+import subprocess
+def mailpasswd(acct):
+ acct = os.path.basename(acct)
+ path = "/home/urbain/.passwords/%s.asc" % acct
+ args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
+ try:
+ return subprocess.check_output(args).strip()
+ except subprocess.CalledProcessError:
+ return ""