Q0510 - Exim/exim GitHub Wiki
Is it possible to write code for scanning messages in Python?
elspy is a layer of glue code that enables you to write Python code to scan email messages at SMTP time. elspy also includes a small Python library with common mail-scanning tools, including an interface to SpamAssassin_ and a simple but effective virus detector. You can obtain elspy from http://elspy.sourceforge.net/.