[Exim] multiple configuration file option broke included scr…

Top Page
Delete this message
Reply to this message
Author: Andreas Metzler
Date:  
To: exim-users
Subject: [Exim] multiple configuration file option broke included scripts
Hello,
Sorry, that I bring this up _after_ 4.11's release but I only found it
last night.

45. A colon-separated list of configuration files can now be given, either in
    the CONFIGURE_ FILE setting in Local/Makefile, or as an argument to the -C
    command line option...


Most/some of the scripts included with exim use something like this,
afaict mainly to find the path to the exim-binary
------------------
01 configure_file_use_node=CONFIGURE_FILE_USE_NODE
02 if [ "$configure_file_use_node" = "yes" ]; then
03   host=`uname -n`
04   if [ ! "$host" != "" ]; then
05       if [ -f CONFIGURE_FILE.$host ]; then
06           hostsuffix=.$host
07       fi
08   fi
09 fi
10 config=CONFIGURE_FILE$hostsuffix
...
11 EXIM_PATH=`grep '^[     ]*exim_path' $config | sed 's/.*=[      ]*//'`
12 if test "$EXIM_PATH" = ""; then EXIM_PATH=BIN_DIRECTORY/exim; fi
------------------


Now substitute CONFIGURE_FILE_USE_NODE with /etc/blah:/etc/foo
05 will never hit. 11 will always fail.

You'll probably need something /like/ this:

configure_file_use_node=CONFIGURE_FILE_USE_NODE
if [ "$configure_file_use_node" = "yes" ]; then
  host=`uname -n`
  if [ ! "$host" != "" ]; then
      if [ -f CONFIGURE_FILE.$host ]; then
          hostsuffix=.$host
      fi
  fi
fi


echo "CONFIGURE_FILE" | sed -e 's/:/
/g' | \
while [ x"$config" = "x" ] && read configfilecand ; do
  if [ -f "${configfilecand}${hostsuffix}" ]; then
    config="${configfilecand}${hostsuffix}"
  fi
done
...


         cu andreas