summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-08-18 09:50:59 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-08-18 09:50:59 -0400
commit05ee689d9ef827cf366ec415354ec092ed5a9e9b (patch)
tree2fb0b5e4c3c31a6a0e36bdaa7876f1e308e25ae5
parent80c7f90d72b70da1d99dc88f20015c4c63ab90be (diff)
notmuch: Update hooks.
-rwxr-xr-xdotfiles/Mail/.notmuch/hooks/post-new10
-rwxr-xr-xdotfiles/Mail/.notmuch/hooks/pre-new10
2 files changed, 12 insertions, 8 deletions
diff --git a/dotfiles/Mail/.notmuch/hooks/post-new b/dotfiles/Mail/.notmuch/hooks/post-new
index 6d1ba05..840a97a 100755
--- a/dotfiles/Mail/.notmuch/hooks/post-new
+++ b/dotfiles/Mail/.notmuch/hooks/post-new
@@ -47,15 +47,15 @@ notmuch tag -new -unread +codeclimate -- from:hello@codeclimate.com
notmuch tag -new -unread +basecamp -- from:notifications@basecamp.com
# Remaining new mail goes to the inbox
+notmuch tag -new +inbox -- tag:new AND NOT tag:unread
notmuch tag -new +inbox +unread -- tag:new
# GNU mailing lists
notmuch tag -inbox +guix -- to:guix-devel@gnu.org OR to:bug-guix@gnu.org
notmuch tag -inbox +guile -- to:guile-devel@gnu.org OR to:guile-user@gnu.org
-notmuch tag -inbox +gnu -- to:gnu-prog-discuss@gnu.org
-notmuch tag -inbox +mediagoblin -- to:devel@mediagoblin.org
-notmuch tag -inbox +gnu-webmasters -- to:www-discuss@gnu.org
+
+# Mark all archived mail
+notmuch tag +archive -- folder:WSU/Archive
# Remove inbox tag from all mail in archive
-notmuch tag -inbox -- folder:WSU/Archive AND tag:inbox
-notmuch tag -inbox -- folder:FSF/INBOX.Archive AND tag:inbox
+notmuch tag -inbox -- tag:archive AND tag:inbox
diff --git a/dotfiles/Mail/.notmuch/hooks/pre-new b/dotfiles/Mail/.notmuch/hooks/pre-new
index db83fa4..151dc85 100755
--- a/dotfiles/Mail/.notmuch/hooks/pre-new
+++ b/dotfiles/Mail/.notmuch/hooks/pre-new
@@ -13,10 +13,14 @@ notmuch tag +deleted -- tag:spam AND date:..one_week
# Delete commits after one month
notmuch tag +deleted -- tag:commits AND date:..one_month
+# Move mail from archive to inbox
+notmuch search --output=files --duplicate=1 NOT tag:archive AND \
+ folder:WSU/Archive \
+ | xargs -I '{}' mv '{}' ~/Mail/WSU/INBOX/cur
+
# Move mail from inbox to archive
-notmuch search --output=files --duplicate=1 folder:WSU/INBOX AND NOT tag:inbox \
+notmuch search --output=files --duplicate=1 tag:archive AND \
+ NOT folder:WSU/Archive \
| xargs -I '{}' mv '{}' ~/Mail/WSU/Archive/cur
-notmuch search --output=files --duplicate=1 folder:FSF/INBOX AND NOT tag:inbox \
- | xargs -I '{}' mv '{}' ~/Mail/FSF/INBOX.Archive/cur
exit 0