Here's an interesting little tool I just ran across: milter-cli, by SnertSoft. It's a milter that takes as command-line argument an external program to run. The program gets the mail to be filtered as input, and returns an exit code telling the milter what to do. Nice, simple, and very general. I might try running bogofilter site-wide using this.