Re: [Exim] question on when address_data is expanded

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: John Jetmore
CC: exim-users
Tárgy: Re: [Exim] question on when address_data is expanded
On Thu, 27 Feb 2003, John Jetmore wrote:

> according to spec.txt address_data is expanded "just before the router is
> run, after all the pre-condition tests have succeeded." Because I can't
> use the $address_data variable in the expansion of router_home_directory,
> this leads me to believe that router_home_directory is being expanded
> before address_data, which implies router_home_directory is a
> pre-condition item. Is this true, and is this intentional?


Well, it's true, as you found out. It wasn't intentional; I suspect I
didn't think about this one.

> It seems like it makes more sense to have this expanded elsewhere, or at
> least after $address_data is available. (OK, I'm not sure if it makes
> more sense or not, but I want it to be that way =)).


router_home_directory is pretty obviously not a pre-condition. In fact,
it is rather like address_data in the sense that it is a data field that
can be used within the router. Therefore, I agree that it should be
expanded later, at the same time as address_data. But should it be
before or after $address_data?

Difficult. After all, you can have it both ways:

address_data = ....something involving $home ...
router_home_directory = ... something involving $address_data ...

Which order would be the more useful? Thinks ...

I must say that I do like the idea of keeping address_data till last,
because that is a nice, clean, specification. That means you can't use
$address_data in router_home_directory, but presumably you can use a
macro to repeat whatever you set address_data to (and if it's a lookup,
it will be cached).

But perhaps it makes more sense to do address_data first, after the
precondition checks - which is what you want.

Any further views from anybody? Either way, I will make this clear in
the documentation in the next edition. Currently I'm teetering on the
fence, but leaning slightly John's way...

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