summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2017-03-26 01:30:13 +0100
committerTharre <tharre3@gmail.com>2017-03-26 01:30:13 +0100
commitfec7a1961ceaf7c9019623ce00ed47569dfcf27f (patch)
treedfa5da7015f0fe921e7c714c1e95998fc1cabbe3
parent9ea9200f95af98a2f4b5d363e3e3439d9ed861bc (diff)
downloaddotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.tar.gz
dotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.tar.xz
dotfiles-fec7a1961ceaf7c9019623ce00ed47569dfcf27f.zip
Enter passwords manually if pass is not available
-rw-r--r--.mbsyncrc2
-rw-r--r--.msmtprc2
-rwxr-xr-x.req_pwd.sh14
3 files changed, 16 insertions, 2 deletions
diff --git a/.mbsyncrc b/.mbsyncrc
index 3b0adc6..c3faa5e 100644
--- a/.mbsyncrc
+++ b/.mbsyncrc
@@ -1,7 +1,7 @@
IMAPAccount tharre3@gmail.com
Host imap.gmail.com
User tharre3@gmail.com
-PassCmd "pass email/tharre3@gmail.com"
+PassCmd "~/.req_pwd.sh email/tharre3@gmail.com"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
diff --git a/.msmtprc b/.msmtprc
index 3b3fe46..3ccf8c9 100644
--- a/.msmtprc
+++ b/.msmtprc
@@ -11,7 +11,7 @@ host smtp.gmail.com
port 587
from tharre3@gmail.com
user tharre3@gmail.com
-passwordeval "pass email/tharre3@gmail.com"
+passwordeval "~/.req_pwd.sh email/tharre3@gmail.com"
# Set a default account
account default : gmail
diff --git a/.req_pwd.sh b/.req_pwd.sh
new file mode 100755
index 0000000..bce131b
--- /dev/null
+++ b/.req_pwd.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+# A simple wrapper script to deal with situations where pass, password-store, or
+# my gpg key is not available.
+
+pass "$1" && exit
+
+# if pass fails, request password manually
+stty -echo
+printf "Password: " >&2
+read passwd
+stty echo
+printf "\n" >&2
+
+printf "$passwd"