summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/mw b/bin/mw
index cdb7856..5503e88 100755
--- a/bin/mw
+++ b/bin/mw
@@ -12,12 +12,14 @@ msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config"
msmtplog="${XDG_STATE_HOME:-$HOME/.local/state}/msmtp/msmtp.log"
mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}"
mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config"
+imapnotify="${XDG_CONFIG_HOME:-$HOME/.config}/imapnotify"
mpoptemp="$muttshare/mpop-temp"
mbsynctemp="$muttshare/mbsync-temp"
mutttemp="$muttshare/mutt-temp"
msmtptemp="$muttshare/msmtp-temp"
onlinetemp="$muttshare/online-temp"
notmuchtemp="$muttshare/notmuch-temp"
+imapnotifytemp="$muttshare/imapnotify-temp"
# With the use of templates, it's impossible to use parameter substitution.
# Therefore, some default variables that might be otherwise overwritten are set
# here.
@@ -78,6 +80,10 @@ prepmpop() {
envsubst <"$mpoptemp" >>"$mpoprc"
}
+prepimapnotify() {
+ mkdir -p "${imapnotify%/*}" ; envsubst < "$imapnotifytemp" >> "$imapnotify/$fulladdr.conf"
+}
+
prepmutt() {
mkdir -p "${muttrc%/*}" "$accdir"
envsubst <"$mutttemp" >"$accdir/$fulladdr.muttrc"
@@ -106,6 +112,7 @@ getprofiles() {
prepmsmtp
prepmutt
prepnotmuch
+ prepimapnotify
}
parsedomains() {
@@ -173,11 +180,11 @@ askinfo() {
[ -z "$passprefix" ] && passprefix=""
hostname="${fulladdr#*@}"
login="${login:-$fulladdr}"
- if [ -n "${password+x}" ]; then
+ if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then
insertpass
- else
+ elif [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then
getpass
- fi
+ fi
}
insertpass() {