Search Content Through Tags
bands Berlin debian disk exim flickr geek Germany gigs Hard disk Holiday images internet Linux load balancing mail server mta Music Photography rant servers solaris spammers squid storage stuff unix Vacation vps warehouseexpress wordpress
Virtual domains in exim4
I’ve been using exim for a while with virtual domain support, and thought it be best to document what I did somewhere.
For a long time I wondered how I might actually support virtual domains in exim 4 and held off by just dumping all mail from all domains into my mailbox (how gosh darn lazy is that).
I finally got bothered enough to, and found a lot of easy to follow help on the internets (google), and came up with the following additions to my exim4.conf :
domainlist localdomains = dsearch;/etc/exim4/virtual : @ : localhost
and in the routers section
begin routers
...
vdom_aliases:
driver = redirect
allow_defer
allow_fail
domains = dsearch;/etc/exim4/virtual
data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}}
retry_use_local_part
pipe_transport = address_pipe
file_transport = address_file
no_more
As you can see there is a directory called /etc/exim4/virtual, which contains several files, each of which define the aliases for a domain, an example file in that directory could look like:
filename: thefraggle.com
* : :fail:
chris : chris@localhost
As you can see this looks pretty simalar to the sendmail aliases file, but requires no rebuilding (if you have used sendmail at some point, you’ll know that you need to issue a “newaliases” command.
Anyway, hopefully that wasn’t too painful, any improvements, suggestions and other observations welcome!
Tags: exim, geek, mail server, mta