Re: [exim] Quoting questions

Top Page
Delete this message
Reply to this message
Author: Steffen Heil (Mailinglisten)
Date:  
To: exim-users@exim.org
Subject: Re: [exim] Quoting questions
Hi


First, thank you very much for the fast answer.


> $ echo '*@b.de: field="value" pass="abcd" key="foo" pass_key="bar me"' >
> TEST
> $ exim -be
> > ${lookup{a@???}lsearch*@{TEST}{$value}fail}
> field="value" pass="abcd" key="foo" pass_key="bar me"
> > ${extract{pass_key}{${lookup{a@???}lsearch*@{TEST}{$value}fail}}}
> bar me


While this is no answer to my question, it is yet way better.
I didn't know that I could test it so easily, I thought I would have to use
log_write and restart exim every time..
I must have missed -be when reading the man page.


> What you need to escape depends upon how you plan to use the value. Is
> it to be a key in a database lookup, in which case there are various
> quote_* expansion operators? Or is it to be passed directly to an
> authenticator?


I am passing these values to a lot of things, but the only ones that could
contain any special characters are used like this:

1) address_data = ${lookup{$local_part@$domain}lsearch*@{FILE }{$value}fail}
2) server_secret = ${extract{pass}{${lookup{$1}lsearch{FILE}{$value}fail}}}
3) server_condition = "${if
eq{$2}{${extract{pass}{${lookup{$1}lsearch{FILE}{$value}fail}}}}{1}{0}}"
4) driver = redirect data = ${expand:${extract{forward}{$address_data}}}

Now I did some testing with -be and it seems that neither lookup nor extract
seems to expand the results:

> $primary_hostname

mx.sh-solutions.de
> ${lookup{a@???}lsearch*@{FILE}{$value}fail}

pass="$primary_hostname" forward="$local_part@???"
> ${extract{pass}{${lookup{a@???}lsearch*@{FILE}{$value}fail}}}

$primary_hostname

Which is good, because it seems to indicate that 1) 2) and 3) will work as
expected.
However, I am now confused why 4) ever worked:

For example:
*@c.de: forward="$local_part@???"

Incoming mail for a@??? was correctly redirected to a@???, yet -be tells
me the expansion yielded "$local_part@???".
Why is this working?

BTW: So it seems the only 2 characters I need to escape in my files are "
and \. I can simple prefix both with \. Right? (Assuming no #0, #10, #13 are
used...)

Best regards,
Steffen