[exim] mysql_servers from config file?

Top Page
Delete this message
Reply to this message
Author: John R. Shearer
Date:  
To: exim-users
Subject: [exim] mysql_servers from config file?
Greetings! I am trying to use Exim's MySQL interface for the first time and
have already run into a little speed bump. I need to be able to collect the
MySQL server name, database name, username and password from an external
configuration file, but can't get it to work.

I'm running Exim version 4.50 from the binary package exim4-daemon-heavy on
Debian GNU/Linux 3.1 "Sarge".

Here's the relevant section from exim4.conf...

  CLUSTER_CONFIG=/etc/puremail/cluster.conf
  hide mysql_servers = \
     ${lookup{HOST}lsearch{CLUSTER_CONFIG}}\
    /${lookup{DB_MAIN}lsearch{CLUSTER_CONFIG}}\
    /${lookup{USER}lsearch{CLUSTER_CONFIG}}\
    /${lookup{PASSWORD}lsearch{CLUSTER_CONFIG}}


...and here's the config file /etc/puremail/cluster.conf...

HOST: localhost
USER: www
PASSWORD: XXXXXXXX
DB_MAIN: PureMail

...and here's the error I get when my first query executes while running
"exim4 -bd -d -v"...

23805 lookup deferred: unexpected slash in MySQL server hostname:
${lookup{HOST}lsearch{/etc/puremail/cluster.conf}}/${lookup{DB_MAIN}lsearch{/
etc/puremail/cluster.conf}}/${lookup{USER}lsearch{/etc/puremail/cluster.conf}
}/${lookup{PASSWORD}lsearch{ 23805 LOG: MAIN PANIC

Obviously the macro CLUSTER_CONFIG is getting expanded like it is supposed
to. If I run "exim4 -be" and enter
"${lookup{HOST}lsearch{/etc/puremail/cluster.conf}}" on the command line it
returns "localhost" as it is supposed to, so I know that the lookup is
working correctly. I also tried defining macros for the host, database,
user and password, and then using the macros (hide mysql_servers =
MYSQL_HOST/MYSQL_DB/MYSQL_USER/MYSQL_PASS) but I receive the same "unexpected
slash in MySQL server hostname" error.

If I hardwire the values (hide mysql_servers =
localhost/PureMail/www/XXXXXXXX) everything works just fine. Anyone have any
thoughts?

Thanks! - John R. S.