While moving my svn repos to git, I pushed out the source for a Qpsmtpd plugin I wrote probably five years ago. It is probably severely outdated, but thought I would post the link here for historical purposes:
https://github.com/redhotpenguin/Summit/blob/master/plugins/summit Warning: this code may be stylistically offensive, as well as just plain crap in certain places :)