Re: [EXIM] Rewriting for not-local_domains

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Torsten Curdt
Date:  
À: Exim-Mailinglist
Sujet: Re: [EXIM] Rewriting for not-local_domains
Philip Hazel wrote:
> On Wed, 8 Jul 1998, Andreas Edler wrote:
> > for an intranet mailserver I want to do rewriting only if the
> > recipient is not in the $local_domain.
> >
> > *@intra.net \
> > {if recipient is not in $local_domain} user@??? \
> > Ffs
> >
> > Is this possible and how do I have to write my rewriting rule?
>
> In general it is not possible, because a message may have many
> recipients, so you can't talk about "the recipient".
>
> Or do you mean do rewriting only if the domain of the address being
> rewritten is not a local domain? You could do that by putting your local
> domains in a file, setting
>
> local_domains = lsearch;/list/of/local/domains
>
> and using a rewriting rule of the form
>
> *@*  "${lookup {$domain}lsearch{/list/of/local/domains}\
>       {$1@$2}{<whatever rewriting you want>}}"   <flags>

>
> However, this is inelegant, because for local domains it does rewrite,
> but to what it was before.
>
> A less expensive, but slightly more dodgy technique is
>
> LOCAL_DOMAINS = your.domain:your.other.domain
>
> local_domains = LOCAL_DOMAINS
>
> *@*  "${if !match{LOCAL_DOMAINS}{${rxquote:$domain}}\
>      {<whatever rewriting you want>} fail}"  <flags>

>
> which does have the advantage of not doing a useless rewrite for local
> domains, and doesn't require a file lookup. However, the test is
> obviously only approximate. If you have only one local domain, you could
> make it an exact test.


Hmm... If I got it right Andreas wants to leave all his local deliveries
untouched (x@??? -> y@???) and wants to rewrite the from-
and
reply-to fields (x@??? -> z@???) to (x@??? ->
z@???)
if the mail goes outside his local domain.

I thought that this is not possible ...
Because rewriting is done per address and not per message?!?

You have to rewrite the address if...
..one of the recipients in the message, the address to be rewritten
belongs to,
is not a local domain!

.. Puh!..

Am I right?

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