summaryrefslogtreecommitdiff
path: root/dotfiles/Mail/.notmuch/hooks/pre-new
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/Mail/.notmuch/hooks/pre-new')
-rwxr-xr-xdotfiles/Mail/.notmuch/hooks/pre-new10
1 files changed, 7 insertions, 3 deletions
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