Re: Dest-dependent source rewrite?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: rich
Cc: exim-users
Asunto: Re: Dest-dependent source rewrite?
On Thu, 10 Apr 1997, Dr. Rich Artym wrote:

> Question: How can I do a rewrite of one header line in a manner that is
> dependent on the content of another header line? The specific problem
> that I'm trying to address is to rewrite local domain names in outgoing
> mail to names that correspond to the domain into which the mail is being
> sent, for hosts that are multihomed into several domains and therefore
> do not have any single "primary" domain.


How do you intend to proceed when a message is being sent to two
different domains that imply different re-writings for the local
domains?

The only logical thing would presumably to send two different messages,
i.e. to have different headers for different deliveries. I'm afraid Exim
isn't up to that.

My belief is that any re-writing that is required on such a scale should
be handled outide the MTA. Get Exim to deliver the message down a pipe
to some script/program that munges it as you like and then re-submits
one or more message back to Exim. It will have to be privileged in order
to pass back the original senders using the -f option. But see also
alternative point below.

> Routers are ideally placed to trigger the rewriting, since typically
> there would be a router dedicated to delivering into each of the home
> target domains.


No. The routers merely decide where the deliveries are to go. It is the
transports that actually do the delivery.

> This suggests that perhaps such functionality could
> be implemented by allowing a router to set a boolean variable which
> can then enable the matching against the regular expression in a
> rewrite rule, in one of two ways: either by extending the regular
> expression syntax to allow an enabling boolean to be specified, or
> by extending the rewrite flags syntax (much easier!). For example,
> the string "bcfrF" in the rewrite example in spec.txt could appear as
> "bcfrF&$xdomain", in which case "bcfrF" lines would be rewritten only
> if variable $xdomain had been asserted by a driver.


The rewriting currently happens when a message is received, long before
any routers get a look at it, though routers can trigger a different
sort of re-writing when a single-domain gets expanded.

Notwithstanding the comment I made about about separate programs, there
is a related item on the Exim wish list which might help here. Somebody
wanted to do automatic encryption on mail to certain domains. I have an
intention (though no details or timescale) to implement a facility on
Exim's transport drivers such that the outgoing message is filtered by a
configured program on its way out. Such a program could encrypt the
message, and could also do any other munging it liked. However, it would
see only the body of the message, not the envelope.

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714