Q0409 - Exim/exim GitHub Wiki
Q0409
I want mail for any local part at certain virtual domains to go to a single address for each domain.
One way to do this is to insert the following code into you exim4 configuration file. For example, under debian this file might be called exim4.conf.template, (depending on your configuration.) Insert the code into the routing section in the configuration file.
virtual:
driver = redirect
data = ${lookup{$domain}lsearch{/etc/virtual}}
You may have to create the /etc/virtual file yourself, then make sure it contains a list of domains and the addresses to which their mail should be sent. For example:
domain1: [email protected]
domain2: [email protected]
If the number of domains is large, using a DBM or cdb file would be more
efficient. If the lookup fails to find the domain in the file, the value
of the data
option is empty, causing the router to decline.