[exim] autoreply router, file_expand won't expand ${lookup}

Top Page
Delete this message
Reply to this message
Author: Mark de Vries
Date:  
To: exim-users
Subject: [exim] autoreply router, file_expand won't expand ${lookup}

Hi,

I'm trying to use a lookup/lsearch in the file used for the autoreply but
it does not get expanded. At first I though maybe only expansion valiables
worked but when I tested with an other expansion item it did work.

What restrictions are there for file_expand that make this work:

${if eq {yes}{no} {true}{false} }

but not this:

${lookup{$local_part@$domain}lsearch{CONFDIR/new_addresses}{$value}{}}

What I'm trying to do is send an auto reply saying something like:
"Thank you for your message to [old-email-addres], in the future please
use [new-email-address]"
where I need to lookup the new address based on the old one.

What would be the best way to do this?

At the moment I've resorted to doing the lookup in the router
using "address_data = ${lookup...}" and then expand $address_data in
the file. This works but I get the feeling this may not be the best way to
do things. (What if I needed to do more/other lookups to conditionally
alter the contents of the message?)

Regards,
Mark.