From 6f38137503ee497d455d9a90510bd5f8ae93cdc5 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Thu, 18 Apr 2019 17:08:29 +0200 Subject: [PATCH] tag based on file location, simplify tagging order, ignore mbsync files, more spammers --- config/afew/config | 27 ++++++++++++++------------- config/afew/spam_filter.py | 25 +++++++++++++++++++++++++ config/alot/config | 7 ++++++- notmuch-config | 2 +- notmuch-hooks/post-new | 10 ++-------- services/notmuch/notmuch | 1 - 6 files changed, 48 insertions(+), 24 deletions(-) diff --git a/config/afew/config b/config/afew/config index c5e648d..d5c3794 100644 --- a/config/afew/config +++ b/config/afew/config @@ -1,29 +1,30 @@ +[SpamFilter] +[KnownSpammers] +[Filter.0] +message = SPAM should not go to inbox +query = tag:spam +tags = -new + +[FolderNameFilter] +folder_blacklist = Inbox Sent Drafts Trash +maildir_separator = / + [TagOrContact.1] -query = to:felixvdj.*@posteo.be OR to:felix.vanderjeugt.*@posteo.net +query = tag:posteo [Filter.1] -message = Tag messages to my UGent account -query = to:felix.vanderjeugt@ugent.be -tags = +ugent - -[Filter.2] message = Tag messages to my Zeus account query = to:felixvdj@zeus.ugent.be tags = +zeus -[Filter.3] +[Filter.2] message = The Dodona alias query = to:dodona@ugent.be tags = +dodona -[Filter.4] +[Filter.3] message = The Unipept alias query = to:unipept@ugent.be tags = +unipept [ListMailsFilter] - -[Filter.0] -message = Add all new messages to the inbox -query = tag:new -tags = +unread;-new diff --git a/config/afew/spam_filter.py b/config/afew/spam_filter.py index 8dcc1b0..58c4169 100644 --- a/config/afew/spam_filter.py +++ b/config/afew/spam_filter.py @@ -2,6 +2,31 @@ from afew.filters.BaseFilter import Filter from afew.FilterRegistry import register_filter spammers = """ +rediffmail.com +msgsu.edu.tr +ecco.spgb.email +academicaloxy.com +sbcglobal.net +sharonwinstonw2@gmail.com +educagri.fr +ac-versailles.fr +bioscopegroup.org +microbiologyreposit.com +ijarcce.com +wsztest.com +outlookconferences.com +cellibc2019.com +web.imrj.online +sib.caister.com +gavin-publishers-group.com +paper-longsslim@daum.net +c2.aoamj-conferences.email +wgc2018-congress.com +saumail.sakarya.edu.tr +journalinsight.org +m.copernicuspublishing.org +aripd.combined@gmail.com +support.aoam.email hbguirui.net foodcongress2019.com congresssummit.com diff --git a/config/alot/config b/config/alot/config index 3c9f945..2fc6e42 100644 --- a/config/alot/config +++ b/config/alot/config @@ -1,11 +1,13 @@ -initial_command = search not tag:archived +initial_command = search query:inbox periodic_hook_frequency = 60 attachment_prefix = /data/temporary prefer_plaintext = True editor_cmd = "dvtm 'vis %s'" +theme = "mutt" + [accounts] [[posteo]] @@ -18,6 +20,7 @@ editor_cmd = "dvtm 'vis %s'" sent_box = maildir:///data/mail/posteo/Sent draft_box = maildir:///data/mail/posteo/Drafts sent_tags = # none + passed_tags = # none sign_by_default = False [[[abook]]] @@ -35,6 +38,7 @@ editor_cmd = "dvtm 'vis %s'" sent_box = maildir:///data/mail/gmail/Sent draft_box = maildir:///data/mail/gmail/Sent sent_tags = # none + passed_tags = # none sign_by_default = True [[[abook]]] @@ -52,6 +56,7 @@ editor_cmd = "dvtm 'vis %s'" sent_box = maildir:///data/mail/ugent/Sent draft_box = maildir:///data/mail/ugent/Sent sent_tags = # none + passed_tags = # none sign_by_default = True [[[abook]]] diff --git a/notmuch-config b/notmuch-config index 7fa1175..78901b5 100644 --- a/notmuch-config +++ b/notmuch-config @@ -49,7 +49,7 @@ other_email=felix.vanderjeugt@ugent.be;felix.vanderjeugt@gmail.com # [new] tags=new; -ignore= +ignore=/.*/.uidvalidity$/;/.*/.mbsyncstate$/; # Search configuration # diff --git a/notmuch-hooks/post-new b/notmuch-hooks/post-new index 1571135..66880bb 100755 --- a/notmuch-hooks/post-new +++ b/notmuch-hooks/post-new @@ -1,11 +1,5 @@ #!/bin/sh -# filtering spam -afew --tag --new -e SpamFilter,KnownSpammers -notmuch tag -new -- tag:spam and tag:new - -# notify for new messages -notmuch search tag:new | cut -d' ' --complement -f1 | xargs -0 --no-run-if-empty notify-send - -# tagging messages 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 diff --git a/services/notmuch/notmuch b/services/notmuch/notmuch index fdd8204..284f62f 100755 --- a/services/notmuch/notmuch +++ b/services/notmuch/notmuch @@ -7,6 +7,5 @@ ip route ls | grep -v '' && exit 1 pgrep gpg-agent >/dev/null || exit 2 notmuch --config="$HOME/.notmuch-config" new --quiet 2>&1 \ - | grep -v "Ignoring" \ | xargs -0 --no-run-if-empty notify-send \ && exec sleep 3m