[Exim] route_list coming from a database

Top Page
Delete this message
Reply to this message
Author: Joachim Wieland
Date:  
To: exim-users
Subject: [Exim] route_list coming from a database
Hi,

I have the following rule to get a route_list in my exim.conf:

smtproutes:
driver = domainlist
transport = remote_smtp
route_list = * "${lookup pgsql{select nexthop from tbl_smtproutes \
where domain = '$domain'}{$value}}" bydns


Now I test the router:

joe@mcrock:~$ /usr/sbin/exim -bt joe@???
joe@??? cannot be resolved at this time:
smtproutes router: failed to expand "${lookup pgsql{select nexthop
from tbl_smtproutes where domain = ": missing } at end of string


To my surprise, when I leave away the quotation marks at $domain, like in:

route_list = * "${lookup pgsql{select nexthop from tbl_smtproutes \
where domain = $domain}{$value}}" bydns

I get:

joe@mcrock:~$ /usr/sbin/exim -bt joe@???
joe@??? cannot be resolved at this time:
smtproutes router: failed to expand "${lookup pgsql{select nexthop
from tbl_smtproutes where domain = $domain}{$value}}": lookup of "select
nexthop from tbl_smtproutes where domain = test.org" gave DEFER: PGSQL:
query failed: ERROR: Relation 'test' does not exist


This is okay now, it is a database error because the quotes are
missing, but do I use a wrong query in my first example or is this a Bug
in exim's-expansion?

I already thought about quoting my '''s :-) but that didn't help
either...



Thanks for your help,

and thanks for exim :-)


Joachim Wieland

--
"There is more than one way to do it." -- Tim Towdi, Spring 1987