Re: Exim confiuration for virtual hosts
On Tue, May 02, 2000 at 03:36:05PM -0400, Chris Mason wrote
> Has anyone installed exim to provide mail serives to a number of domains. I
> have a webserver running virtual hosts and I would like to provide mail
> serives for those domains. Exim is running fine for sending mail buit I
> would like to receive the mail for those domains and put all the mail for
> each domain into the user account for that domain.
> Thanks for any help you can offer.
>
Here's how I do it.
The virtual hosts (www.mydomain.com, mail.mydomain.com)
all have 'A' records pointing to my mail/web server;
MX records don't work as well, because stupid mail
programs/systems put the MX host in the envelope.
My exim.conf contains (all single lines, however your mail client displays
them):
Main section:
local_domains = localhost:my.net.au:*.my.net.au:partial3-lsearch;/etc/exim/clients/domains
Directors:
A new director, to handle the virtual hosts:
virtual:
driver = aliasfile
except_domains = localhost:my.met.au:*.my.net.au
domains = partial3-lsearch;/etc/exim/clients/domains
no_more
file = /etc/exim/clients/$domain_data
search_type = lsearch*
All other directors have a line like
domains = localhost:my.net.au:*.my.net.au
so that they aren't applied to the virtual hosts.
/etc/exim/clients/domains contains lines like
*.mydomain.com.au: mydomain
The second field is just an identifier, and for each
identifier there is another file, e.g., /etc/exim/clients/mydomain,
which works like a regular alias file, e.g.:
*: myclient@my.net.au
This setup is for virtual domains with three parts in their
domain name (e.g., *.mydomain.com.au); minor adjustment is
required if you use "American" style domains (e.g.,
*.somewhere.com), and you can mix them easily enough (with a
longer local_domains line and a further director).
HTH,
John P.
--
huiac@camtech.net.au
john@huiac.apana.org.au
http://www.mdt.net.au/~john Debian Linux admin & support:technical services
Reply to: