From 1311c30e84aa6378dd242c6d7b44cb106a6bfa2f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 1 Oct 2020 09:04:24 +0200 Subject: [PATCH] mail: Fix mail filtering Fixed correct filtering of inbox stuff in afew (moving archived mails out of inbox, moving trash into GMail Trash). --- mail/.config/aerc/binds.conf | 5 +++-- mail/.config/afew/config | 6 +++--- mail/.local/bin/mail-check | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mail/.config/aerc/binds.conf b/mail/.config/aerc/binds.conf index 5e5609e..03de89a 100644 --- a/mail/.config/aerc/binds.conf +++ b/mail/.config/aerc/binds.conf @@ -42,9 +42,10 @@ D = :prompt 'Really delete this message?' 'delete-message' mi = :modify-labels +inbox -archived -deleted mm = :modify-labels +flagged mI = :modify-labels +flagged +dd = :modify-labels +deleted -inbox md = :modify-labels +deleted -inbox -mD = :modify-labels -deleted -ma = :modify-labels -deleted -inbox +mD = :modify-labels -deleted +ma = :modify-labels -inbox -deleted C = :compose diff --git a/mail/.config/afew/config b/mail/.config/afew/config index 190ccea..b30059d 100644 --- a/mail/.config/afew/config +++ b/mail/.config/afew/config @@ -1,6 +1,6 @@ # filter creation [InboxDumpingFilter(Filter)] -query = '(tag:dump or folder:Dump) and (tag:inbox or tag:unread)' +query = (tag:dump or folder:Dump) and (tag:inbox or tag:unread or tag:new) tags = -new;-inbox;-unread;+dump message = removing dumped mails from inbox @@ -11,8 +11,8 @@ folder_transforms = Dump:dump maildir_separator = / [ArchiveSentMailsFilter] sent_tag=sent -[InboxFilter] [InboxDumpingFilter.0] +[InboxFilter] # moving mode [MailMover] @@ -20,5 +20,5 @@ folders = Inbox Dump rename = True max_age = 15 # rules -Inbox = 'tag:dump':Dump +Inbox = 'tag:dump':Dump 'NOT tag:inbox AND NOT tag:dump AND NOT tag:spam':'[Google Mail]/All Mail' 'tag:deleted':'[Google Mail]/Trash' Dump = 'NOT tag:spam AND NOT tag:dump AND tag:inbox':Inbox diff --git a/mail/.local/bin/mail-check b/mail/.local/bin/mail-check index b98b749..0fb8657 100755 --- a/mail/.local/bin/mail-check +++ b/mail/.local/bin/mail-check @@ -32,7 +32,9 @@ posthook() { fi notmuch new 2>/dev/null - afew --tag --new -C "${XDG_CONFIG_HOME:-/home/marty/.config}/notmuch/config" + afew --tag --new + afew --move-mail --new + afew --tag --new countnew }