Exim is a highly configurable message transfer agent (MTA) for Unix system. It excels at providing possible solutions for almost any mail configuration. Among others it has an internal filter scripting language and a built-in Perl interpreter. Using it's string expansion system one can write database lookups, call external scripts or create custom rulesets of almost any kind.
The official documentation is almost unrivaled in the open source world. Unlike Postfix, it is monolithic by design, and has therefore been criticized by security experts. The security record of Exim however is fairly clean, only a handful of serious security issues have emerged along the years.