Which Tools do you use for Mail filtering? - eviltoast

Hi Folks,

it may or may not be directly related to a self hosted solution since as former IT Sysadmin I am aware of issues when it comes down to self hosted email solutions but for a group with privacy and custom solutions in mind I feel like this would still be the place to ask my question.

I really do like what gmail does with it´s pre-filter logic and classification for ads, social and default emails but I would like to move things away from google and others.

What I am searching for would be a tool to, similiar as google, pre-filters and oragnizes my emails.
I do not search for a E-Mail provider which provides this toolset with a inbox since I do want to use my own domain name(s).
A WebUI to read and write emails would be nice to have but I would also be fine with forwarding to a email client.

Self Hosted would obviously be prefered but I would not mind either if it is a (paid) online service.

What do you guys use for this kind of scenario? What could you recomment?

Thanks for your insights!