Re: [exim] Custom Variable

Góra strony
Delete this message
Reply to this message
Autor: Peter Bowyer
Data:  
Dla: exim-users
Temat: Re: [exim] Custom Variable
Ryan LeBlanc <ryan@???> wrote:
> Well, I have been scratching my head on this for the last 4 hours,
> and it is time to ask for help. I have scoured google, the archives,
> and the exim docs to no avail. But, it is probably something super
> simple I am just not seeing.
>
> I need to assign a custom variable from data in a MySql lookup for
> use in a transport. Like this:
>
> my_transport:
>       driver = pipe
> ??--> ryans_var = ${lookup mysql{select blah from blah where
> column='$local_part'}{$value}}
>       command = "/usr/local/bin/prog --option $ryans_var"

>
> I just can't figure out how this is done.


The 'address_data' option is ideal for this sort of thing ... except that it
needs to be set in the router, not the transport.

my_router:
    driver = accept
    address_data = ${lookup mysql{select blah from blah where true==false
and black==white}{$value}}
    transport = my_transport


my_transport:
       driver = pipe
       command = "/usr/local/bin/prog --option $address_data"


http://www.exim.org/exim-html-4.40/doc/html/spec_15.html

Peter