[exim] sanity check, please?

Top Page
Delete this message
Reply to this message
Author: Noah Meyerhans
Date:  
To: Exim-users
Subject: [exim] sanity check, please?
Hi all. I've got a legacy domain that I'd like to turn into a virtual
host. This is straightforward, and I've got a bunch of these. This one
is somewhat different, though, because there are a whole mess of other
domains that, using MX records, are basically synonymous with this one
domain. I'd like to avoid any sort of static configuration for these
various other domains, since they'll all "legacy" and should gradually
go away. I'd also prefer to abstract the specific domain names out of
the exim config, so I can do this for additional domains in the future
if needed.

In other words, we've got foo.example.com, which I'd like to turn into
the virtual host. But then we've also got bar.example.com that lists
foo.example.com as it's primary MX.

So I've created these routes:

legacy_mx:
driver = manualroute
domains = @mx_primary : !+local_domains
self = pass
route_data = ${lookup dnsdb{mxh=$domain}}

legacy_redirect:
driver = redirect
domains = @mx_primary : !+local_domains
condition = def:self_hostname
data = ${lookup {$local_part}dbm{/etc/exim/$self_hostname.db}}
allow_fail
allow_defer

The idea is that I'll create an A record in DNS for
foo-legacy-mx.example.com that points to this host. The various MX
entries for the domains will be updated to list this host, rather than
the original target (call it foo.example.com). Then
/etc/exim/foo-legacy-mx.example.com.db will be a dbm database of the
aliases for this virtual host configuration. Exim will know to check
that file because the legacy-mx route will set $self_hostname when it
passes control to the legacy-mx-redirect route.

This seems to work in simple cases when testing, but I'd like to see
what others think. Is this a reasonable approach? Is there a better
way?

Thanks,
noah

-- 
Noah Meyerhans                         System Administrator
MIT Computer Science and Artificial Intelligence Laboratory