Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function notmuch {
- /usr/local/bin/notmuch $@
- }
- function alltags {
- notmuch search-tags | sed -e 's/^/tag:/' -e 's/$/ or/'
- }
- function echo_exec {
- echo $@
- $@
- }
- ## Sync Notmuch and IMAP ##
- echo_exec /home/josh/.local/bin/notmuchsync -s
- echo_exec notmuch new
- ## Global Filters ##
- # To Email Accounts
- echo_exec notmuch tag +gmail \
- to:mellowcellofellow@gmail.com and not tag:gmail
- echo_exec notmuch tag +home \
- to:cellofellow.homelinux.net or \
- from:bb_rendrag and not tag:home
- echo_exec notmuch tag +janasite \
- to:josh@janagardner.info or \
- to:root@janagardner.info and not tag:janasite
- echo_exec notmuch tag +jobs \
- to:joshuagardner.co.cc and not tag:jobs
- echo_exec notmuch tag +weber \
- to:joshuagardner1@mail.weber.edu or \
- to:joshuagardner1@weber.edu and not tag:weber
- echo_exec notmuch tag +local \
- to:cellofellow.is-a-geek.org and not tag:local
- # From Email Accounts
- echo_exec notmuch tag +sent +gmail \
- from:mellowcellofellow@gmail.com and not tag:sent and not tag:gmail
- echo_exec notmuch tag +sent +home \
- from:cellofellow.homelinux.net and not tag:sent and not tag:home
- echo_exec notmuch tag +sent +janasite \
- from:josh@janagardner.info or \
- from:root@janagardner.info and not tag:sent and not tag:janasite
- echo_exec notmuch tag +sent +jobs \
- from:joshuagardner.co.cc and not tag:sent and not tag:jobs
- echo_exec notmuch tag +sent +weber \
- from:joshuagardner1@mail.weber.edu or \
- from:joshuagardner1@weber.edu and not tag:sent and not tag:weber
- echo_exec notmuch tag +sent +local \
- from:cellofellow.is-a-geek.org and not tag sent and not tag:local
- echo_exec notmuch tag -unread tag:sent and tag:unread
- # Social networking tags
- echo_exec notmuch tag -inbox +buzz \
- subject:buzz and from:gmail.com and not tag:buzz
- echo_exec notmuch tag -inbox +facebook \
- from:facebook.com or \
- from:facebookmail.com or \
- from:facebookappmail.com or \
- from:familybuildermail.com and \
- not tag:facebook
- echo_exec notmuch tag -inbox +twitter \
- from:twitter.com and not tag:twitter
- echo_exec notmuch tag -inbox +identi.ca \
- from:identi.ca and not tag:identi.ca
- echo_exec notmuch tag -inbox +goodreads \
- from:goodreads.com and not tag:goodreads
- ## Mark all other mail "untagged" ##
- echo_exec notmuch tag -untagged \
- \($(alltags | grep -v untagged) tag:tagged\) and tag:untagged
- echo_exec notmuch tag +untagged \
- not \($(alltags) tag:tagged\)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement