summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
authorCarlos Lobo <86011416+CarlosLoboxyz@users.noreply.github.com>2023-03-25 19:56:47 -0400
committerCarlos Lobo <86011416+CarlosLoboxyz@users.noreply.github.com>2023-03-25 19:56:47 -0400
commit058fc42c215355379d7ed082b0e30acad20bda52 (patch)
tree52793d38c18005b2871312e9d37a2de02637d8ab /bin/mw
parent4d533e4f2f15944e0c8802cc5ad521c6d26fdf06 (diff)
Add goimapnotify for push notifications
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/mw b/bin/mw
index 2baa5f7..ab9c36d 100755
--- a/bin/mw
+++ b/bin/mw
@@ -12,12 +12,14 @@ msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config"
msmtplog="${XDG_CACHE_HOME:-$HOME/.cache}/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.
@@ -64,6 +66,8 @@ prepmbsync() { mkdir -p "${mbsyncrc%/*}" ; [ -f "$mbsyncrc" ] && echo >> "$mbsyn
prepmpop() { mkdir -p "${mpoprc%/*}" ; envsubst < "$mpoptemp" >> "$mpoprc" ;}
+prepimapnotify() { mkdir -p "${imapnotify%/*}" ; envsubst < "$imapnotifytemp" >> "$imapnotify/$fulladdr.conf" ;}
+
prepmutt() { mkdir -p "${muttrc%/*}" "$accdir"
envsubst < "$mutttemp" > "$accdir/$fulladdr.muttrc"
[ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc"
@@ -90,6 +94,7 @@ getprofiles() { \
prepmsmtp
prepmutt
prepnotmuch
+ prepimapnotify
}
parsedomains(){ serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)"