From 595269331941298961b9cf7665e7c7eb6a081e44 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Thu, 27 Jun 2019 11:07:20 +0200 Subject: [PATCH] swap inbox and archived tags - again --- config/afew/config | 11 ++++++++--- config/afew/spam_filter.py | 8 ++++++++ config/alot/.gitignore | 1 + config/alot/config | 26 +++++++++++++------------- config/alot/hooks.py | 0 notmuch-config | 2 +- notmuch-hooks/post-new | 4 +--- 7 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 config/alot/.gitignore create mode 100644 config/alot/hooks.py diff --git a/config/afew/config b/config/afew/config index e5b25f8..665f7a9 100644 --- a/config/afew/config +++ b/config/afew/config @@ -1,10 +1,10 @@ -[SpamFilter] -[KnownSpammers] - [FolderNameFilter] folder_blacklist = Inbox Sent Drafts Trash maildir_separator = / +[SpamFilter] +[KnownSpammers] + [TagOrContact.1] query = tag:posteo @@ -23,4 +23,9 @@ message = The Unipept alias query = to:unipept@ugent.be tags = +unipept +[Filter.4] +query = tag:dodona and subject:'Onderwijsinstelling aangemaakt voor .*' +tags = -new + [ListMailsFilter] +[InboxFilter] diff --git a/config/afew/spam_filter.py b/config/afew/spam_filter.py index ce6b838..8421699 100644 --- a/config/afew/spam_filter.py +++ b/config/afew/spam_filter.py @@ -2,6 +2,13 @@ from afew.filters.BaseFilter import Filter from afew.FilterRegistry import register_filter spammers = """ +golbalpublication.online +all.bg +vodokanal.poltava.ua +qingteng.xyz +guaranten.com +remedyonlineoa.info +pharm2019-sa.com nsitysim.com onlinepublishers.co ijeert.com @@ -159,3 +166,4 @@ class KnownSpammers(Filter): def handle_message(self, message): self.add_tags(message, 'spam') + self.remove_tags(message, 'new') diff --git a/config/alot/.gitignore b/config/alot/.gitignore new file mode 100644 index 0000000..98478da --- /dev/null +++ b/config/alot/.gitignore @@ -0,0 +1 @@ +themes/ diff --git a/config/alot/config b/config/alot/config index 627511f..715b6e7 100644 --- a/config/alot/config +++ b/config/alot/config @@ -1,5 +1,5 @@ -initial_command = search query:inbox +initial_command = search tag:inbox periodic_hook_frequency = 60 edit_headers_blacklist = Content-Type, MIME-Version attachment_prefix = /data/temporary @@ -22,7 +22,7 @@ theme = "mutt" sendmail_command = /usr/bin/msmtp --account=posteo -t sent_box = maildir:///data/mail/posteo/Sent draft_box = maildir:///data/mail/posteo/Drafts - sent_tags = posteo + sent_tags = posteo,inbox passed_tags = # none sign_by_default = False @@ -40,7 +40,7 @@ theme = "mutt" sendmail_command = /usr/bin/msmtp --account=gmail -t sent_box = maildir:///data/mail/gmail/Sent draft_box = maildir:///data/mail/gmail/Sent - sent_tags = gmail + sent_tags = gmail,inbox passed_tags = # none sign_by_default = True @@ -58,7 +58,7 @@ theme = "mutt" sendmail_command = /usr/bin/msmtp --account=ugent -t sent_box = maildir:///data/mail/ugent/Sent draft_box = maildir:///data/mail/ugent/Sent - sent_tags = ugent + sent_tags = ugent,inbox passed_tags = # none sign_by_default = True @@ -74,7 +74,7 @@ theme = "mutt" sendmail_command = /usr/bin/true sent_box = maildir:///data/mail/todo draft_box = maildir:///data/mail/todo - sent_tags = todo + sent_tags = todo,inbox passed_tags = # none @@ -84,25 +84,25 @@ theme = "mutt" n = compose --sender todo@localhost --to todo [[search]] - x = tag spam - a = tag archived - A = untag archived + x = toggletags spam,inbox + a = untag inbox + A = tag inbox [[thread]] - a = tag archived ; fold - A = untag archived ; unfold + a = untag inbox ; fold + A = tag inbox ; unfold n = nextpart p = prevpart u = pipeto --background selecturl [tags] + [[inbox]] + translated = + [[encrypted]] translated = - [[archived]] - translated = - [[replied]] translated = diff --git a/config/alot/hooks.py b/config/alot/hooks.py new file mode 100644 index 0000000..e69de29 diff --git a/notmuch-config b/notmuch-config index 78901b5..27dff23 100644 --- a/notmuch-config +++ b/notmuch-config @@ -88,4 +88,4 @@ exclude_tags=spam; synchronize_flags=true [query] -inbox=not tag:spam and not tag:archived +inbox=tag:inbox diff --git a/notmuch-hooks/post-new b/notmuch-hooks/post-new index d91d452..d614d7b 100755 --- a/notmuch-hooks/post-new +++ b/notmuch-hooks/post-new @@ -1,6 +1,4 @@ #!/bin/sh afew --tag --new -notmuch search tag:new | cut -d' ' --complement -f1 | xargs -0 --no-run-if-empty notify-send -notmuch tag -new +unread -- tag:new -notmuch tag -new -unread -- tag:spam +notmuch search tag:unread | cut -d' ' --complement -f1 | xargs -0 --no-run-if-empty notify-send