From fec7a1961ceaf7c9019623ce00ed47569dfcf27f Mon Sep 17 00:00:00 2001 From: Tharre Date: Sun, 26 Mar 2017 01:30:13 +0100 Subject: Enter passwords manually if pass is not available --- .mbsyncrc | 2 +- .msmtprc | 2 +- .req_pwd.sh | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 .req_pwd.sh 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" -- cgit v1.2.3-70-g09d2