summaryrefslogtreecommitdiff
path: root/mut
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2023-10-22 12:18:05 +0200
committerMike Vink <ivi@vinkies.net>2023-10-22 12:18:05 +0200
commitb52eb0ddce7c8a476351f38fedfea92e83b23f18 (patch)
tree87b01873a5ba33b0326b9ee63e043fd97723062e /mut
parentbc2c557650e076aaf6d47bbc99bc67f99b26aa27 (diff)
fix emails to gmail
Diffstat (limited to 'mut')
-rwxr-xr-xmut/bin/notmuch-hook8
1 files changed, 6 insertions, 2 deletions
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