summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/mw b/bin/mw
index a143f17..f7adda5 100755
--- a/bin/mw
+++ b/bin/mw
@@ -60,7 +60,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 mail/mutt/<yourgpgemail>\` to set up a password archive."
+ echo "First run \`pass init mail/<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
}
@@ -179,7 +179,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
+ pass rm -f "mail/$passprefix$fulladdr" >/dev/null 2>&1
[ -n "${purge+x}" ] && safename="$(echo $fulladdr | sed 's/@/_/g')" && rm -rf "${cachedir:?}/${safename:?}" "${maildir:?}/${fulladdr:?}"
}
@@ -206,15 +206,15 @@ askinfo() {
[ -z "$passprefix" ] && passprefix=""
hostname="${fulladdr#*@}"
login="${login:-$fulladdr}"
- if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr.gpg" ]; then
+ if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr.gpg" ]; then
insertpass
- elif [ ! -f "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr.gpg" ]; then
+ elif [ ! -f "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr.gpg" ]; then
getpass
fi
}
insertpass() {
- printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr"
+ printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr"
}
errorexit() {
@@ -233,15 +233,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
+ pass rm -f "mail/$passprefix$fulladdr" >/dev/null 2>&1
+ pass insert -f "mail/$passprefix$fulladdr" && break
done; }
getboxes() {
if [ -n "${force+x}" ]; then
mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nJunk\\nTrash")"
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:$(pass "mail/$passprefix$fulladdr" | head -1)" --url "${protocol:-imaps}://$imap:${iport:-993}")"
[ -z "$info" ] && errorexit
unsorted_mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')"
desired_order="Archive INBOX Drafts Sent Junk Trash"
@@ -334,12 +334,14 @@ Options allowed with -a:
-s SMTP server address
-S SMTP server port
-x Password for account (recommended to be in double quotes)
- -X Delete an account's local email too when deleting
+
+Options allowed with -d/-D:
+ -X Delete an account's local email too when deleting
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 '(pass prefix with -P option)'your@email.com\`.
+To change an account's password, run \`pass edit 'mail/(pass prefix with -P option)'your@email.com\`.
EOF
}