Re: [exim] shell commands in exim.conf macros?

Top Page
Delete this message
Reply to this message
Author: Fred Viles
Date:  
To: exim-users
Subject: Re: [exim] shell commands in exim.conf macros?
On 1 Sep 2005 at 22:25, OpenMacNews wrote about
    "[exim] shell commands in exim.conf ":


| hi all,
|
| is it possible to expand a shell command in an exim.conf macro?


Any place where string expansion takes place can use the ${run
expansion item to run a shell command.

Macros are simple textual replacement, so they are not relevant to
your question. That is, you can certainly define a macro whose value
contains ${run, but whether it will work depends on where the macro
is *used*. If the macro is used in a place where string expansion is
not done, ${run won't work. Either way, it doesn't matter that the
${run got there via a macro replacement.

|...
| but this, with the "dig" cmd
|      MY_HOSTNAME         = mybox.mydomain.com
|      MY_DNS              = 10.0.0.6
|      MY_IP               = `dig +short @MY_DNS MY_HOSTNAME`


The syntax would be
       MY_IP = ${run {dig +short @MY_DNS MY_HOSTNAME} {$value}}


|      local_interfaces    = MY_IP : 127.0.0.1 : ::::1


But as best I can tell from the manual, local_interfaces is not
expanded, so this won't work as you wish.

- Fred