Re: [Exim] Access to the *matched* $domain_data in a directo…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Philip Hazel
Data:  
Para: Joe Emenaker
CC: exim-users
Asunto: Re: [Exim] Access to the *matched* $domain_data in a director?
On Mon, 13 Sep 1999, Joe Emenaker wrote:

> Now, I noticed something when I was looking through the docs on the ability
> to have domain lookup files for the "local_domains" directive. In that
> directive, you can specify "partial-" and it causes Exim to do wildcard
> matches. So, if I say:
>
> local_domains = "partial-lsearch;/etc/exim.domains"
>
> and then, in /etc/exim.domains, I put things like:
>
> *.domain.com
>
> then all subdomains of "domain.com" are considered local. Cool! Now, the
> *really* cool part is that the documentation says that, in some parts of the
> conf file, the *matched* domain (which I'm taking to mean, the part of the
> destination domain that was matched in my exim.domains file) is available
> through the "$domain_data" variable. Hot damn!


That's not quite what happens. First of all, when it says "the data from
the lookup", it means the data that was looked up. So if the looked up
line was

*.domain.com    <this (rest of line) is the "domain data">


Secondly, the definition of $domain_data is

$domain_data: When a director or a router has a setting of the domains generic
option, and that involves a file lookup, the data associated with the key in
the file is available during the running of the director or router as
$domain_data. In all other situations, this variable expands to nothing.

So you have to set the "domains" option in order to use $domain_data.
The following configuration (I have not tested it) should therefore
work:

local_domains = "partial-lsearch;/etc/exim.domains"

domain_aliases:
driver = aliasfile
domains = partial-lsearch;/etc/exim.domains
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases.d/$domain_data
search_type = lsearch*

and in /etc/exim.domains you would have lines like

*.domain.com    domain.com
*.domain2.org   domain2.org 





-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.