aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-08-16 17:38:41 +0300
committerawy <awy@awy.one>2025-08-16 17:38:41 +0300
commit2f233ca560720f1fb48616f2dadfbc3871078a0f (patch)
tree4ec8efc57c7da3295861131a0437d78838ff05b0 /bin
parent4a773aa74bd9da4ff609eafbacc504661d33705c (diff)
use gopass as backendHEADmaster
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mailsync4
-rwxr-xr-xbin/mw15
2 files changed, 9 insertions, 10 deletions
diff --git a/bin/mailsync b/bin/mailsync
index f52ead5..c7f133f 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -14,7 +14,7 @@
# Run only if not already running in other instance
pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;}
-# First, we have to get the right variables for the mbsync file, the pass
+# First, we have to get the right variables for the mbsync file, the gopass
# archive, notmuch and the GPG home. This is done by searching common profile
# files for variable assignments. This is ugly, but there are few options that
# will work on the maximum number of machines.
@@ -24,7 +24,7 @@ eval "$(grep -h -- \
"$HOME/.config/zsh/.zshenv" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" \
"$HOME/.pam_environment" 2>/dev/null)"
-# For non-interactive shell (e.g. cron job) run only when the GPG key (in $GNUPGHOME or pass --homedir) is unlocked
+# For non-interactive shell (e.g. cron job) run only when the GPG key (in $GNUPGHOME or gopass --homedir) is unlocked
tty -s || (echo "dummy" | gpg --sign --batch --yes -o /dev/null > /dev/null 2>&1) || exit
export GPG_TTY="$(tty)"
diff --git a/bin/mw b/bin/mw
index 58a8be6..21ffa64 100755
--- a/bin/mw
+++ b/bin/mw
@@ -58,7 +58,7 @@ checkbasics() {
command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
[ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || {
- echo "First run \`pass init <yourgpgemail>\` to set up a password archive."
+ echo "First run \`gopass init <yourgpgemail>\` to set up a password archive."
echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)"
exit 1
}
@@ -94,7 +94,6 @@ prepmutt() {
envsubst <"$mutttemp" >"$accdir/$fulladdr.muttrc"
[ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" >"$muttrc"
! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $muttshare/mutt-wizard.muttrc" >>"$muttrc"
- ! grep -q "^source.*nord.muttrc" "$muttrc" && echo "source $muttshare/nord.muttrc" >>"$muttrc"
! grep "^source.*.muttrc" "$muttrc" | grep -qv "$muttshare/mutt-wizard.muttrc" && echo "source $accdir/$fulladdr.muttrc" >>"$muttrc"
echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source $accdir/$fulladdr.muttrc<enter><change-folder>!<enter>;<check-stats>' \"switch to $fulladdr\"" >>"$muttrc"
neomutt -v | grep -q lmdb && ! grep -q "^set header_cache_backend.*lmdb" "$muttrc" && echo "set header_cache_backend = \"lmdb\"" >>"$muttrc"
@@ -160,7 +159,7 @@ delete() {
rm -f "$msmtprc"bu
sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null
rm -f "$mpoprc"bu
- pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1
+ gopass rm -f "$passprefix$fulladdr" >/dev/null 2>&1
[ -n "${purge+x}" ] && safename="$(echo $fulladdr | sed 's/@/_/g')" && rm -rf "${cachedir:?}/${safename:?}" "${maildir:?}/${fulladdr:?}"
}
@@ -195,7 +194,7 @@ askinfo() {
}
insertpass() {
- printf "%s" "$password" | pass insert -fe "$passprefix$fulladdr"
+ printf "%s" "$password" | gopass insert -fe "$passprefix$fulladdr"
}
errorexit() {
@@ -214,15 +213,15 @@ Please be sure you either enable third-party applications, or create an app-spec
}
getpass() { while :; do
- pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1
- pass insert -f "$passprefix$fulladdr" && break
+ gopass rm -f "$passprefix$fulladdr" >/dev/null 2>&1
+ gopass insert -f "$passprefix$fulladdr" && break
done; }
getboxes() {
if [ -n "${force+x}" ]; then
mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")"
else
- info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")"
+ info="$(curl --location-trusted -s -m 5 --user "$login:$(gopass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")"
[ -z "$info" ] && errorexit
mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')"
fi
@@ -306,7 +305,7 @@ Options allowed with -a:
NOTE: Once at least one account is added, you can run
\`mbsync -a\` to begin downloading mail.
-To change an account's password, run \`pass edit '$passprefix'your@email.com\`.
+To change an account's password, run \`gopass edit '$passprefix'your@email.com\`.
EOF
}