elspy is a layer of glue code that enables you to write Python code to scan email messages at SMTP-time with the Exim MTA (mail transport agent). It also includes a small Python library with common mail-scanning tools, including an interface to SpamAssassin and a simple-but-effective virus detector.