Looks like klammail can be used in procmail recipes as a filter for incoming email similar to
Clamassassin. If you need a procmail recipe for that you can check the Clamassassin documentation, or better, use Clamassassin for filtering.
Don't know about filtering outgoing email. If it's similar to the "add a bogus legal footer" stuff you'll have to rebuild Sendmail, Milter and whatnot.