Traditional methods of doing this on SA wiki talk about shell scripts as content filters.
Well that's an additional fork
syscall on every email and the volume that will flow through the machine is significant. Not to mention that shell/bash scripts themselves are hardly efficient.
Is there a more efficient way of spam filtering in Postfix?
(and no, Amavis is not an option - that's an explicit requirement handed over to me).