Sounds like a project to me
It may come to that, actually. What I have that works well under Windows is SpamEater Pro, a stand-alone mail application that can download message headers from the pop server, delete them, put them back and more. It works with blacklists as well as regex, whitelist and blacklist filters. The one thing it does not do is statistical analysis, and so far that's not really a concern though it would be a nice to have.
Since it has been discontinued, there's no easy way to make it work under Wine as it requires activation. I captured the registry entries and so I can install it over and over, but that does not really help in an emulated environment where double-click on a registry file is not available.