It reminds me of slimta[0], a Python framework for building Mail Transfer Agents. I used it to run some custom code to detect SPAM characteristics of incoming emails.
Thank you! I want to implement an e-mail gateway for our web application that fans out e-mails to various commercial MTAs and this seems like it would be a useful building block for that.