FAQ / Routing for local delivery / Q0409
Q0409
Question
I want mail for any local part at certain virtual domains to go to a single address for each domain.
Answer
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: postmaster@some.where.else domain2: joe@xyz.plc
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.
FAQ / Routing for local delivery / Q0409
