Re: Virtual Hosts question

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: david
Dátum:  
Címzett: Philip Hazel
CC: exim-users
Tárgy: Re: Virtual Hosts question
On Mon, 19 May 1997, Philip Hazel wrote:

> 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.


Indeed. As I worked on it the last few days I came up with the following:

virtual:
domains = lsearch;/etc/mail/v-domains,
driver = aliasfile;
file = /etc/mail/v-aliases/$domain,
search_type = lsearch

virtual_default:
domains = lsearch;/etc/mail/v-domains,
driver = smartuser,
no_more;
new_address = ${lookup{$domain}lsearch{/etc/mail/v-aliases/$domain}
{$value}fa
il}

And it occurs to me that the smartuser could handle it from a single file
by looking up {$local_part@$domain}, and looking up $domain if that fails.

Thanks for such a configurable mailer:)

--- David Miller


----------------------------------------------------------------------------
        It's *amazing* what one can accomplish when 
            one doesn't know what one can't do!