Re: [Exim] sanity check please

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Peter D. Gray
Fecha:  
A: exim-users
Asunto: Re: [Exim] sanity check please
On Thu, Oct 30, 2003 at 11:16:54AM +0100, Andreas Metzler wrote:
> On Thu, Oct 30, 2003 at 10:34:48AM +1100, Peter D. Gray wrote:
>> I am moving from sendmail to exim and writing a config file. I use
>> the sendmail generics feature to rewrite the local user part of
>> addresses, both incoming and outgoing. I have got my exim config to
>> do the same thing but the rule is a bit messy and I just want a few
>> other eyes on it to tell me if my approach is sane.
>
> > The rewrite rule is
>
> > # If they are generic domains, rewrite local part
> >
>> *@* "${if eq
>>    {${lookup{$domain}lsearch{GENERIC_DOMAINS}{OK}fail}}{OK}\
>>    {${lookup{$local_part}dbm{GENERIC_MAP}{$value}fail}@$domain}fail}"
>>    Eh
> [...]

>
> In exim4 rewrite patterns are address-lists, so something like this
> might work, while being more readable:
>
> *@lsearch;GENERIC_DOMAINS \
> ${lookup{$local_part}dbm{GENERIC_MAP}{$value}fail}@$domain Eh
>


Works perfectly and is, as you say, much more readable.

Thanks Andreas.

I think it would be better if the value of $value stayed
available after the lookup until another lookup is
performed. In other words, do not revert it at the end
of a substitution.

Comments?

Regards,
pdg

--

See mail headers for contact information.