For these examples, you need the Exim Mail Transport Agent, preferrably with Tom Kistner's Exiscan-ACL patch applied. Prebuilt Exim+Exiscan-ACL packages exist for the most popular Linux distributions as well as FreeBSD; see the Exiscan-ACL home page for details.
The final implementation example at the end incorporates these additional tools:
SpamAssassin - a popular spam filtering tool that analyzes mail content against a large and highly sophisticated set of heuristics.
greylistd - a simple greylisting solution written by yours truly, specifically with Exim in mind.
Other optional software is used in examples throughout.
In particular, Exim is perhaps most popular among users of Debian GNU/Linux, as it is the default MTA in that distribution. If you use Debian ("Sarge" or later), you can obtain Exim+Exiscan-ACL by installing the exim4-daemon-heavy package: