Re: Virtual Hosts question

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: david
CC: exim-users
Subject: Re: Virtual Hosts question
On Fri, 16 May 1997 david@??? wrote:

> I'm still learning how to configure exim....
>
> I have two questions about virtual hosts:
>
> 1) Is there anyway to lump all the aliases in a single file in the form:
>
> user@???:    real@???
> user@???:    real2@???

>
> as opposed to having the aliases in a per-domain file?


I have made a note to think about alias files of this form. Meanwhile,
you could use a rewrite rule like

*@* ${lookup{$local_part@$domain}lsearch{/some/file}{$value}fail} T

The "T" flag at the end causes this rule to be applied only to the
envelope "to" field, not to any of the headers.

> 2) Is there anyway to have unmatched local_part @ virtual domains sent to
> some default user?


You can do that using a smartuser director, but you could re-search the
same file for the domain only, so you have two rules:

*@* ${lookup{$local_part@$domain}lsearch{/some/file}{$value}fail} T
*@* ${lookup{$domain}lsearch{/some/file}{$value}fail} T

That will work *only* if the result of the first rewriting always
produces an address that fails in the second lookup, i.e. if none of
your domain1.com's are the same as user.com.

I'm sure there are other ways as well.

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714