Mail-CLI-dotfiles/mail/.notmuch/hooks/post-new

44 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2020-08-30 18:10:18 +02:00
#!/bin/sh
notmuch tag --batch <<-EOF
+list +ccc-intern +ccc -- thread:"{tag:new and to:intern@lists.ccc.de}"
+list +ccchb +ccc -- thread:"{tag:new and to:ccc@lists.ccchb.de}"
+list +ffhb -- thread:"{tag:new and to:liste@bremen.freifunk.net}"
+list -- thread:"{tag:new and from:mailman}"
+dev +github -- thread:"{tag:new and from:@github.com}"
+dev +gitlab -- thread:"{tag:new and from:@mg.gitlab.com}"
+dev -- thread:"{tag:new and from:dev@sum7.eu}"
+dev -- thread:"{tag:new and to:+dev@}"
+dev +ci -- thread:"{tag:new and from:dev@sum7.eu and subject:Pipeline}"
+dev +ci -- thread:"{tag:new and to:+dev@ and subject:Pipeline}"
+dev +ci -- thread:"{tag:new and from:builds@circleci.com}"
+mon -- thread:"{tag:new and to:+mon@}"
+mon -- thread:"{tag:new and to:arch-security@archlinux.org}"
+host -- thread:"{tag:new and to:+host@}"
+ccc -- thread:"{tag:new and to:+ccc@}"
+junk -- thread:"{tag:new and folder:fireorbit/Junk}"
EOF
# set it for notification
~/.local/bin/mailnotify
notmuch tag -new tag:new
notmuch tag -inbox tag:inbox not tag:unread
echo "MOVE MAILS TO FOLDER BY TAGS:"
## move folders
echo "> junk"
notmuch search --output=files tag:junk \
and not folder:fireorbit/Junk | grep -v ~/mail/fireorbit/old | grep -v ~/mail/h | mrefile -v ~/mail/fireorbit/Junk
echo "> inbox (no junk)"
notmuch search --output=files not tag:junk \
and folder:fireorbit/Junk | grep -v ~/mail/fireorbit/old | grep -v ~/mail/h | mrefile -v ~/mail/fireorbit-inbox
echo "> trash"
notmuch search --output=files tag:killed \
and not tag:junk \
and not folder:fireorbit/Trash | grep -v ~/mail/fireorbit/old | grep -v ~/mail/h | mrefile -v ~/mail/fireorbit/Trash
mbsync -a -H