From 34f3845769670dc5799d60d5201ed8ca637968a5 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Sun, 22 Dec 2024 11:07:36 +0100 Subject: . --- home/dots/mail/.notmuch/hooks/pre-new | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 home/dots/mail/.notmuch/hooks/pre-new (limited to 'home/dots/mail/.notmuch/hooks/pre-new') diff --git a/home/dots/mail/.notmuch/hooks/pre-new b/home/dots/mail/.notmuch/hooks/pre-new new file mode 100755 index 0000000..949d909 --- /dev/null +++ b/home/dots/mail/.notmuch/hooks/pre-new @@ -0,0 +1,8 @@ +#!/run/current-system/profile/bin/bash +notmuch search --output=files "path:/.*/INBOX/" tag:home and tag:deleted | while IFS= read -r f; do mv -v $f $(echo $f | sed 's/INBOX/Trash/' | sed 's/,U=[0-9]*:/:/'); done + +notmuch search --output=files "path:/.*/INBOX/" tag:home and tag:receipt and not tag:inbox | while IFS= read -r f; do mv -v $f $(echo $f | sed 's/INBOX/Archive\/Receipt/' | sed 's/,U=[0-9]*:/:/'); done + +notmuch search --output=files "path:/.*/INBOX/" tag:home and tag:flight and not tag:inbox | while IFS= read -r f; do mv -v $f $(echo $f | sed 's/INBOX/Archive\/Flight/' | sed 's/,U=[0-9]*:/:/'); done + +notmuch search --output=files "path:/.*/INBOX/" tag:home and not tag:inbox | while IFS= read -r f; do mv -v $f $(echo $f | sed 's/INBOX/Archive/' | sed 's/,U=[0-9]*:/:/'); done -- cgit v1.2.3