Re: Exim and multiple domains
On Sun, Aug 20, 2000 at 07:03:17PM -0500, Will Trillich wrote
> </lurk mode>
>
> i'm still hoping to find the king james version of the
> exim manual (the original greek is beyond me)...
>
> this flashed by a few days ago, and i thought i'd be able
> to apply it to my own situation; alas...
>
> On Thu, Aug 17, 2000 at 12:09:41AM +0930, John Pearson wrote:
> > There's more than one way to skin a cat, but here's what I've
> > done; it allows you to have an arbitrary number of virtual
> > domains with each having its own alias file, which allows
> > you to do most things including what you are looking for.
> >
> > Some of my virtual hosts are in .com.au, and some are in .com; I
> > have a file for domains with three parts (e.g., mydomain.com.au)
> > at /etc/exim/domains, and a file for domains with two parts at
> > /etc/exim/domains2. Each file contains lines like this:
> >
> > *.mydomain.com.au myfile
> > *.otherdomain.com.au otherfile
> >
> > for each domain. My setup allows me to match arbitrary
> > subdomains (e.g., mail.outgoing.mydomain.com); if you don't want
> > to match subdomains you can omit the "*." from each line, and
> > use a single file for all domains. The second field is the name
> > of an aliasfile for the domain matched by the first field.
>
> in my /etc/exim/domains file, i've got:
> *dontuthink.com will
>
> > To forward all mail for a domain to "myuser's" local mailbox,
> > the specified file need contain only the line:
> >
> > * myuser
> >
> > but it can also use any construct that Exim recognises in alias
> > files (pipes, :blackhole:, etc.).
>
> btw--does the second field denote an aliasfile name or a user
> name to redirect mail to?
>
> > In exim.conf, I set local_domains like this:
> >
> > local_domains = localhost:my.net.au:*.my.net.au:\
> > partial3-lsearch;/etc/exim/clients/domains:\
> > partial2-lsearch;/etc/exim/clients/domains2
> >
> > The "partial*-lsearch;" allows me to match arbitrary subdomains
> > (e.g., mail.outgoing.mydomain.com.au). If you don't want to match
> > subdomains you can put all virtual domains into one file and use
> > just "lsearch;"
>
> my exim.conf contains:
> local_domains = localhost:*serensoft.com:lsearch;/etc/exim/domains
> and
> virtual:
> driver = aliasfile
> domains = lsearch;/etc/exim/domains
> no_more
> file = /etc/exim/domains
> search_type = lsearch*
>
> mail to the main site (serensoft.com) gets through as it should, but
> of course (if your eyes are trained on what to look for i'm sure
> it'll be obvious) email to anything@dontuthink.com gets frozen:
>
> lowest MX record for dontuthink.com points to local host
>
> short version: what am i missing?
> long version: how would a newbie diagnose this kind of thing?
>
If you only want to match the top-level domain dontuthink.com
and not subdomains like "mail.dontuthink.com" (as seems to be
the case, from how you've set your local_domains line) then
leave out the wildcards from /etc/clients/domains, like so:
dontuthink.com will
The second field is the name of a file. The director that I use
("virtual") retrieves this field as $domain_data. The file contains
aliases for users in that domain; the simplest case is a file like
* will
which forwards all mail for the domain to will.
Your virtual director should look more like this:
virtual:
driver = aliasfile
except_domains = localhost:serensoft.com:*.serensoft.com
domains = lsearch;/etc/exim/domains
no_more
file = /etc/exim/$domain_data
search_type = lsearch*
The except_domains is probably not really necessary, but
prevents the driver matching your 'non-virtual' domains
(the "domains=" line should be enough). The "lsearch*"
(in place of just "lsearch") allows wildcard matching in the
aliasfile.
In the example you gave, there would be an aliasfile for
dontuthink.com at /etc/exim/will that, for example, might
contain the line
* will
to forward all mail for dontuthink.com to the local user
called Will.
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: