From b52eb0ddce7c8a476351f38fedfea92e83b23f18 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Sun, 22 Oct 2023 12:18:05 +0200 Subject: fix emails to gmail --- mut/bin/notmuch-hook | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mut') diff --git a/mut/bin/notmuch-hook b/mut/bin/notmuch-hook index da376b6..32cf9ab 100755 --- a/mut/bin/notmuch-hook +++ b/mut/bin/notmuch-hook @@ -8,10 +8,14 @@ notmuch tag -new +inbox +unread -- tag:new # Gmail + mbsync = a lot of duplicates due to the archive notmuch tag -new -inbox +archive -- 'folder:/Archive/ -folder:/Inbox/ -folder:/\[Gmail\]/ -folder:/FarDrafts/ -folder:/Important/ -folder:/Sent/' +notmuch tag --remove-all +sent -- folder:/Sent/ +notmuch tag --remove-all +drafts -- folder:/Drafts/ # Tag messages with files that were moved to trash in neomutt notmuch tag --remove-all +trash -- folder:/Trash/ + # Same but with messages with files that were moved to spam -notmuch tag --remove-all +spam -- folder:/Spam/ +notmuch tag --remove-all +spam -- folder:/Spam/ or folder:/Junk/ # Remove files of messages that were tagged but still have files left behind in the mailbox, should be fine since gmail already keeps a duplicate in the Archive so the message will not be deleted only one file of the message -notmuch search --output=files -- 'folder:/Inbox/ -tag:inbox' | grep Inbox | xargs >/dev/null 2>&1 rm +# TODO(): make this work with non gmail emails too +# notmuch search --output=files -- 'folder:/Inbox/ -tag:inbox' | grep Inbox | xargs >/dev/null 2>&1 rm -- cgit v1.2.3