summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rwxr-xr-x.mutt/maildir_watch_setup.sh16
2 files changed, 20 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 1c8940e..9a8f075 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,9 +13,10 @@
/.local/share/mc/history
# mutt
-.mutt/folders
-.mutt/gpg
-.mutt/hcache
+/.mutt/folders
+/.mutt/gpg
+/.mutt/hcache
+/.mutt/maildir_watch.sh
# ssh
/.ssh/*
diff --git a/.mutt/maildir_watch_setup.sh b/.mutt/maildir_watch_setup.sh
new file mode 100755
index 0000000..53d9bb4
--- /dev/null
+++ b/.mutt/maildir_watch_setup.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# see misc/crontab
+# the script suppose ./folders file with one folder per-line,
+# prefixed with '=' and ending with '\'
+
+wget https://raw.github.com/erikw/dotfiles/personal/bin/maildir_watch.sh -O- \
+ | sed \
+ -e "s|\(maildir_path=\"\)[^\"]*\"|\1$(
+ grep -E 'set folder\s+=' ../.muttrc | tr -d ' ' | cut -d= -f2 | sed 's|\~|$HOME|'
+ )\"|" \
+ -e "s|\(mailboxes=(\)[^)]*)|\1$(
+ grep -E '=[A-Za-z0-9.-]+\s.*\\' folders \
+ | sed 's|^=\([A-Za-z0-9.-]\+\)\s.*$|\1|' | paste -s
+ ))|" > maildir_watch.sh
+chmod +x maildir_watch.sh