What makes Exim work as a mailer construction kit

November 12, 2009

In light of Postfix versus Exim, you might wonder what features make Exim into a mailer construction kit. For me, the easiest way to summarize the answer is to say that Exim has the idea of what I will call a user-written mail processing pipeline (actually two of them, sort of).

By a mail processing pipeline I mean a series of steps that messages go through to decide what will happen to them and how they will be delivered. In many MTAs, this processing pipeline is more or less fixed, with you having opportunities to add a table lookup here or mangle addresses there. In Exim, there is no fixed processing pipeline; you write it entirely from scratch yourself, using relatively generic components to do most of the work. The result is that you have a great deal of flexibility in what happens in those pipelines; in other words, how messages get handled and delivered is to a large extent under your direct control.

(The two drawbacks of this are that you have to write the pipeline yourself and that it is much easier to screw things up in various ways, some of them subtle.)

Conceptually, Exim has two major places with this sort of processing flexibility. The first is deciding how to route an address to one or more delivery destinations; you write a series of what Exim calls 'routers', and then they get used in sequence to process each address in various ways, hopefully ultimately delivering them somewhere.

(The Exim documentation describes routers and this routing process in a way that makes it sound less powerful than it is.)

The other major place with such a processing pipeline is deciding what reply code to give for each SMTP command in a SMTP conversation. In Exim you do this by writing a series of ACL rules for each command, again using relatively generic components to do most of the hard work. These rules can do quite powerful and generic things, and the combination can be quite powerful.

(Exim also gets a fair bit of its general power from its crazy string expansion language; this comes up when writing both routers and SMTP ACL rules.)

Comments on this page:

From at 2009-11-12 06:21:08:

Reminds me of qpsmtpd, except with an ad-hoc mini-language.

Aristotle Pagaltzis

By cks at 2009-11-12 22:38:01:

I'm conflicted about using real languages in MTAs. On the one hand, ad-hoc mini-languages generally limited, often horrible, and obscure the logic involved. On the other hand, real languages are usually too low-level; you can wind up doing so many things by hand that you obscure the logic anyways. I theorize that the happy middle would be using a real language where most of the heavy lifting was done by utility routines supplied by the MTA, and the language was mostly used to express the logic flow between them.

Written on 12 November 2009.
« For universities, the Internet world has fundamentally changed
(Ab)using Exim routers for their full power »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Thu Nov 12 01:36:25 2009
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.