Re: [exim] Re: command line macros

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Sergei Gerasenko
Data:  
Para: exim-users
Asunto: Re: [exim] Re: command line macros
Thanks for going into the trouble of creating those test cases.
You're absolutely right. After your reply, I ran a couple of tests with
the same results...

I know what the problem is now. Somehow I thought that if I pass -D
macros when starting exim as a daemon, then all command line invocations
of Exim will automatically use them, which is obviously not the case.

This little discovery will make using macros for excluding parts of the
configuration file a little problematic.

See, I have two hosts and at any given time either host 1 forwards all mail
to host 2 or host 2 forwards all mail to host 1. Who forwards to whom
depends on certain conditions.

Ideally, I would like to keep one configuration file for both hosts. The
problem with macros is that for this to work I would need to find every
place where direct invocations of exim are made and pass the appropriate
-D's as paramaters. Not good :)

Anybody know a good way of handling this?

> 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

>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/


On Mon, Mar 20, 2006 at 09:01:18PM +0100, Andreas Metzler wrote:
> 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.
>