[exim] Re: command line macros

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Andreas Metzler
Date:  
À: exim-users
Sujet: [exim] Re: command line macros
Sergei Gerasenko <gerases@???> wrote:
> I need to define a macro only under certain conditions. That's why I
> thought I'll just use the -D option when I start exim. But it seems like
> if a macro with the same name doesn't exist in the configuration file,
> the -D version of the same macro doesn't make it to exim.


> For example, if I do "exim -DMACRO1" and MACRO1 is not defined in the
> configuration file, .ifdef MACRO1 will return false. On the other hand,
> if I do define that macro in the configuration file, .ifdef MACRO1 will
> always be true (even if MACRO1 is defined as MACRO1=). So, I'm stuck.


Works for me, at least in a minimal testcase:
-----------------
ametzler@argenau:~$ cat  /tmp/exim4.conf.test
.ifdef XXXX
exim_path = blah
.endif
ametzler@argenau:~$ /usr/sbin/exim  -C /tmp/exim4.conf.test  -bP exim_path
exim_path = /usr/sbin/exim4
ametzler@argenau:~$ /usr/sbin/exim -DXXXX -C /tmp/exim4.conf.test \
                     -bP exim_path
exim_path = blah
-----------------
             cu andreas
-- 
The 'Galactic Cleaning' policy undertaken by Emperor Zhark is a personal
vision of the emperor's, and its inclusion in this work does not constitute
tacit approval by the author or the publisher for any such projects,
howsoever undertaken.                                (c) Jasper Ffforde