qpsmptd is an SMTP daemon written in perl which is moduler in design, and allows the development of plugins to provide extremely flexible handling of incoming email.
You can learn more from the qpsmtpd homepage, and the qpsmtpd wiki.
I put together a series of documented plugins which work together to provide a coherant and scalable anti-spam system for a single host. This package of plugins all work together and allow you to perform a large number of SMTP-time spam-checks for multiple domains.
The collection of plugins is distributed at the mail-scanning-lite page. These plugins represent the distilled wisdom of running a commercial anti-spam company, which was written up and documented (post-shutdown) at the mail-scanning.com website.
This section contains several stand-alone plugins which might provide inspiration to others - these plugins unlike the previous collection are entirely stand-alone.
- badsubject
This plugin is will reject messages at SMTP-time if they have locally blacklisted Subject: headers.
- check_bogus_bounce
Reject invalid bounce messages, which are bounces addressed to multiple recipients.
- check_system_load
This plugin is designed to protect your mailserver from suffering in a DoS condition, by temporarily refusing new connections when your server load has risen above a configurable threshold.
- log_details
This informational plugin will add headers to each incoming message to record the connecting hosts' IP address, DNS name, and similar details.
- spam_gourmet
This flexible plugin allows you to generate and distribute transient email addresses, which expire after they have been used a given number of times.