Using Exim with Archiveopteryx

Exim can be configured to deliver mail to Archiveopteryx via LMTP. You'll need to define a new transport, and route mail to it using a suitable router, as explained below.

By default, our smtp server accepts LMTP connections on 127.0.0.1, port 2026. If you've changed the values of lmtp-address or lmtp-port in archiveopteryx.conf, set hosts and port to the new values in the transport definition below. First, add the Archiveopteryx domain (example.com below) to the local_domains domainlist and also create one for aox. This allows you to leave local delivery alone and/or have other domains not delivered into Archiveopteryx. domainlist local_domains = @ : example.com : exemplo.com.br domainlist aox_domains = example.com : exemplo.com.br Next, create a router for Archiveopteryx and add it to the top of the routers section because Exim will take the first hit. # Route mail to the archiveopteryx transport. archiveopteryx: driver = accept domains = +aox_domains transport = archiveopteryx Transport: Transport can be in any order. # Delivers mail via LMTP to Archiveopteryx at 127.0.0.1:2026. archiveopteryx: driver = smtp protocol = lmtp hosts = 127.0.0.1 port = 2026 allow_localhost = true hosts_avoid_tls = 127.0.0.1

First, add this to the "transports" section of exim.conf:

# Delivers mail via LMTP to Archiveopteryx at 127.0.0.1:2026. archiveopteryx: driver = smtp protocol = lmtp hosts = 127.0.0.1 port = 2026 allow_localhost = true hosts_avoid_tls = 127.0.0.1

If you're delivering to a different host, you don't need to set "allow_localhost", and you may not want to set "hosts_avoid_tls" (using TLS with localhost gives us no benefit, so we can avoid the expensive negotiation).

Next, you'll need to route mail to this transport using a suitably configured director or router in exim.conf. The example below creates one named archiveopteryx that directs mail addressed to any of the domains in the aox_domains domainlist via the transport we defined above.

domainlist aox_domains = example.com : example.org # Route *@example.com mail to the archiveopteryx transport. archiveopteryx: driver = accept domains = +aox_domains transport = archiveopteryx

This router should go at the top of the routers section in the configuration file.

A complete example

The following example is taken from a user's Exim 3.3x installation where the objective was to try out Archiveopteryx for a few users on a new server, but to leave mail delivery otherwise unchanged. (Note that in Exim 4.x, one would use the accept driver described above, rather than the now-removed smartuser driver.)

In this example, Exim is running on mail.example.org (192.0.2.1), and Archiveopteryx is on aox.example.org (192.0.2.2). Mail is delivered into local spool files on mail.example.org, but we want to forward an extra copy to aox.example.org.

First, we configure Archiveopteryx to accept LMTP connections from mail.example.org by adding the following to archiveopteryx.conf:

lmtp-address = 192.0.2.2 lmtp-port = 2026

Then, on mail.example.org, we define a new transport named archiveopteryx in exim.conf:

# Delivers mail via LMTP to 192.0.2.2:2026. archiveopteryx: driver = smtp protocol = lmtp hosts = 192.0.2.2 port = 2026

Next, to continue normal delivery to local users, but add a copy to be delivered to aox.example.org, we added entries like the following to /etc/aliases:

foo: foo, foo@aox.example.org

Finally, we added "aox.example.org" to "local_domains" in exim.conf, and added a new director named tarkovsky to handle the extra alias as follows:

# Directs mail to *@aox.example.org to the archiveopteryx transport, # after rewriting the address to *@example.org tarkovsky: driver = smartuser domains = aox.example.org new_address = ${quote:$local_part}@example.org transport = archiveopteryx

Note that we remove the extra "aox." from the address before we deliver the message, so Archiveopteryx users continue to use their normal addresses (e.g. aox add user foo pwd foo@example.org for the alias above).

Please let info@aox.org know if you have other Exim configuration tips to share.

Relevant links

In case you have any questions, write to info@aox.org.

About this page

Last modified: 2011-12-22
Location: aox.org/exim