Another extremely happy user of the following combination waves hi:

• Mutt

• OfflineIMAP (to be replaced with `mbsync`; OfflineIMAP is not being ported to Python 3, unfortunately)

• Notmuch — for fast indexing, searching, and tagging e-mails

• Postfix — Mail Transfer Agent; offline queuing. Overall, it's one of the most robust pieces of software; Postfix never failed even once on me in nearly six years.

I can recommend https://github.com/lefcha/imapfilter.

I have it running in a private serving, filtering the emails for me..