Re: [exim] Conditional file include?

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: D. Dante Lorenso
Dátum:  
Címzett: D. Dante Lorenso, exim-users
Tárgy: Re: [exim] Conditional file include?
Phil Pennock wrote:
> On 2007-08-24 at 14:21 -0500, D. Dante Lorenso wrote:
>> I'm trying to do a conditional file include so that I can roll out the
>> same exim configs to several hosts. I can't seem to get this to work:
>>
>>     .include /etc/exim/host/${primary_hostname}.conf

>>
>>     ---
>>     Starting exim: 2007-08-24 14:10:54 Exim configuration
>>     error in line 5 of /etc/exim/exim.conf: failed to open
>>     included configuration file
>>     /etc/exim/host/${primary_hostname}.conf
>>     ---

>>
>> Can this be done? Does string replacement happen before include? If
>> not, is there some type of if/then/else or switch syntax that could be
>> cooked up to do different includes based on the value in $primary_hostname?
>
> This is all fully yet concisely documented in section 6.3 of The Exim
> Specification, "6.3 File inclusions in the configuration file", which
> states how early in the parsing process the inclusions are done, what
> parsing steps happen _before_ the include processing, etc.
>
> The Exim Specification is available online (via www.exim.org and its
> mirrors) and should also have been included with your distribution as a
> plaintext file named "spec.txt".
>
> Sections 6.3 through 6.9 are all likely to be of interest to you.


Thanks for your RTFM suggestion. Did that. Was hoping someone might
have an architecture recommendation on how I CAN do what I'm trying to
do ...

Notice also my question about asking for alternatives based on
$primary_hostname. I have a follow up message in this thread somewhere
where I also present option for using .ifdef but need help figuring out
how to conditionally define macros.

-- Dante