Re: [EXIM] Rewrite rules

Top Page
Delete this message
Reply to this message
Author: Steve Sargent
Date:  
To: exim-users
Subject: Re: [EXIM] Rewrite rules
Philip,

Thanks for the help. The following rewrite rule works perfectly:-

*@*     ${lookup{$local_part}lsearch{/usr/local/exim/tables/\


${lookup{$domain}partial-lsearch{/usr/local/exim/tables/rewrite_domains}{$value}
}-aliases}\
                        {$value}fail}@???  Ffrs






Regards





Steve.



>On Fri, 18 Dec 1998, Steve Sargent wrote:
>
>> I want to look the domain up in a file of domain names and use the returned
>> value as a part of the file name for the second lookup.
>>
>> The rewrite rule is:-
>>
>> *@lsearch;/usr/local/exim/tables/rewrite_domains \
>>      ${lookup{$local_part}lsearch{/usr/local/exim/tables/$value-aliases}\
>>                         {$value}fail}@???  Ffrs

>
>This doesn't make sense. The variable $value is the result of a lookup.
>Therefore, you cannot make use of it as part of the name of the file in
>which you are going to look it up. Surely what you want is
>
>*@lsearch;/usr/local/exim/tables/rewrite_domains \
>     ${lookup{$local_part}lsearch{/usr/local/exim/tables/$domain-aliases}\
>                        {$value}fail}@???  Ffrs

>
>> rewrite_domains contains:-
>>
>> qmwcc8.qmw.ac.uk:compserv
>>
>> compserv-aliases contains:-
>>
>> cgaa392:B.Harding
>
>Oh, I see, it isn't as simple as that. Well, in that case, you have to
>replace $domain above with
>
>${lookup{$domain}lsearch{/usr/local/exim/tables/rewrite_domains}{$value}}
>
>This will be quite efficient, since Exim caches lookups.
>
>--
>Philip Hazel            University of Cambridge Computing Service,
>ph10@???      Cambridge, England. Phone: +44 1223 334714.



|--------------------------------------------------------------------------|
| Steve Sargent, Vox +44 171 775 3220, Fax +44 171 775 3221                |
| QMW Computing Services,  Mile End Road,  London E1 4NS, UK               |
| Email   : S.L.Sargent@???                                          |
| WWW page: http://www.qmw.ac.uk/~cgaa160/index.html                       |
|                                                      |                   |
|                                         PIPER       _|_                  |
|                                         PA28R  ____/___\____             |
|                                         ___________[=o=]___________      |
|                                         ARROW    e/  o  \e               |

|--------------------------------------------------------------------------|



--
*** Exim information can be found at http://www.exim.org/ ***