Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function notmuch {
  4. /usr/local/bin/notmuch $@
  5. }
  6.  
  7. function alltags {
  8. notmuch search-tags | sed -e 's/^/tag:/' -e 's/$/ or/'
  9. }
  10.  
  11. function echo_exec {
  12. echo $@
  13. $@
  14. }
  15.  
  16. ## Sync Notmuch and IMAP ##
  17.  
  18. echo_exec /home/josh/.local/bin/notmuchsync -s
  19. echo_exec notmuch new
  20.  
  21. ## Global Filters ##
  22.  
  23. # To Email Accounts
  24. echo_exec notmuch tag +gmail \
  25. to:mellowcellofellow@gmail.com and not tag:gmail
  26. echo_exec notmuch tag +home \
  27. to:cellofellow.homelinux.net or \
  28. from:bb_rendrag and not tag:home
  29. echo_exec notmuch tag +janasite \
  30. to:josh@janagardner.info or \
  31. to:root@janagardner.info and not tag:janasite
  32. echo_exec notmuch tag +jobs \
  33. to:joshuagardner.co.cc and not tag:jobs
  34. echo_exec notmuch tag +weber \
  35. to:joshuagardner1@mail.weber.edu or \
  36. to:joshuagardner1@weber.edu and not tag:weber
  37. echo_exec notmuch tag +local \
  38. to:cellofellow.is-a-geek.org and not tag:local
  39.  
  40. # From Email Accounts
  41. echo_exec notmuch tag +sent +gmail \
  42. from:mellowcellofellow@gmail.com and not tag:sent and not tag:gmail
  43. echo_exec notmuch tag +sent +home \
  44. from:cellofellow.homelinux.net and not tag:sent and not tag:home
  45. echo_exec notmuch tag +sent +janasite \
  46. from:josh@janagardner.info or \
  47. from:root@janagardner.info and not tag:sent and not tag:janasite
  48. echo_exec notmuch tag +sent +jobs \
  49. from:joshuagardner.co.cc and not tag:sent and not tag:jobs
  50. echo_exec notmuch tag +sent +weber \
  51. from:joshuagardner1@mail.weber.edu or \
  52. from:joshuagardner1@weber.edu and not tag:sent and not tag:weber
  53. echo_exec notmuch tag +sent +local \
  54. from:cellofellow.is-a-geek.org and not tag sent and not tag:local
  55.  
  56. echo_exec notmuch tag -unread tag:sent and tag:unread
  57.  
  58. # Social networking tags
  59. echo_exec notmuch tag -inbox +buzz \
  60. subject:buzz and from:gmail.com and not tag:buzz
  61.  
  62. echo_exec notmuch tag -inbox +facebook \
  63. from:facebook.com or \
  64. from:facebookmail.com or \
  65. from:facebookappmail.com or \
  66. from:familybuildermail.com and \
  67. not tag:facebook
  68.  
  69. echo_exec notmuch tag -inbox +twitter \
  70. from:twitter.com and not tag:twitter
  71. echo_exec notmuch tag -inbox +identi.ca \
  72. from:identi.ca and not tag:identi.ca
  73. echo_exec notmuch tag -inbox +goodreads \
  74. from:goodreads.com and not tag:goodreads
  75.  
  76.  
  77. ## Mark all other mail "untagged" ##
  78. echo_exec notmuch tag -untagged \
  79. \($(alltags | grep -v untagged) tag:tagged\) and tag:untagged
  80. echo_exec notmuch tag +untagged \
  81. not \($(alltags) tag:tagged\)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement