Gmail filters are a pain because it's hard to make them hierarchical (i.e. you can't say, "Apply this filter first, then based on the result of that, apply this other filter"), and you cannot filter by contact groups or even by contacts. I have a specific set of rules for how I want my e-mail configured.
Is there any, preferably FOSS, software that will retrieve my e-mail and apply filters as I desire? Ideally, I'd do something like set up a gmail filter dropping everything into some label like "unfiltered" (skipping the inbox), then I'd have an always-on device that would receive push notifications from that folder and apply my filters. I would not be OK if this caused push notifications for things that do in fact hit the inbox to fail.
A less ideal situation would be a mail server that I control to which I forward all my incoming e-mail and filter based on that. I am worried about reliability and the complexity of sending e-mails without being spam-blackholed when running my own mail server.
I should explicitly note that any e-mail client that does this should be syncing the labels back with gmail. This is something I'm envisioning running from a raspberry pi connected to an always-on connection.