32 lines
828 B
Bash
32 lines
828 B
Bash
#!/bin/sh
|
|
|
|
# Script to be run after mailboxes have been synchronized
|
|
# Expects `notmuch` in the PATH
|
|
|
|
# Index new mail
|
|
notmuch new
|
|
|
|
# Remove the inbox tag from all mails not inside any inbox
|
|
notmuch tag -inbox not path:'/.*/Inbox/'
|
|
|
|
# Add tags for messages in their respective folders
|
|
notmuch tag +archive path:'/.*/Archive/'
|
|
|
|
notmuch tag +junk path:'/.*/Spam/'
|
|
|
|
notmuch tag +trash path:'/.*/Trash/'
|
|
notmuch tag +trash path:'/.*/Gel&APY-scht/'
|
|
notmuch tag +trash path:'/.*/Papierkorb/'
|
|
|
|
notmuch tag +sent path:'/.*/Sent/'
|
|
notmuch tag +sent path:'/.*/Gesendet/'
|
|
|
|
notmuch tag +draft path:'/.*/Drafts/'
|
|
notmuch tag +draft path:'/.*/Entw&APw-rfe/'
|
|
|
|
# Tag all mail according to their accounts
|
|
notmuch tag +pm path:'/PM/'
|
|
notmuch tag +gmx path:'/GMX/'
|
|
notmuch tag +uni path:'/UNI/'
|
|
notmuch tag +schulverwalter path:'/schulverwalter/'
|