Re: [exim] Bug in string expansion of exim configuration?

Inizio della pagina
Delete this message
Reply to this message
Autore: Jasen Betts
Data:  
To: exim-users
Oggetto: Re: [exim] Bug in string expansion of exim configuration?
On 2016-12-22, Forum <forum@???> wrote:
> Hello exim developers,
>
> must i write to the exim-dev mailing list?
>
> I am running a mailsystem on Debian jessie with Exim version 4.84_2 #1 built 25-Jul-2016.
>
> In my configuration i am trying to use some values fetching from an mysql database.
> This is working in the router section for identifying the users without problem.
>
> But when i try get the values for spam it fails!
>
>
> Here this configuration:
>
> That's what is working now - but it is not per user
>        condition = ${if >{$spam_score_int}{50}{1}{0}}

>
>
> That's what i want to do:
>
>        condition = ${if >{$spam_score_int}{${eval:10*{${lookup mysql{ SELECT DISTINCT spam_threshold FROM user WHERE
> username='${quote_mysql:$local_part}' AND domain='${quote_mysql:$domain}' AND SMTP_allowed='YES'}}}}}{true}{false}}

>
>
> This will result in:
>
> temporarily rejected after DATA: failed to expand ACL string
> "${if >{$spam_score_int}{${eval:10*{${lookup mysql{ SELECT DISTINCT spam_threshold FROM user WHERE
> username='${quote_mysql:$local_part}' AND domain='${quote_mysql:$domain}' AND SMTP_allowed='YES'}}}}}{true}{false}}":
> error in expression evaluation: expecting number or opening parenthesis (after processing "10*")
>
>
> From my point of view the syntax is correct.
> Can you help me to see the error?


from that error message:

that bit where it says "eval:10*{${lookup"
should say "eval:10*(${lookup" or possibly "eval:10*${lookup"


looking at the lookup

and you're probably going to want a default expansion in the lookup
so "SMTP_allowed='YES'}}" becomes "SMTP_allowed='YES'}{$value}{-99}}"

or something like that to cover the cases where no result is found in
the database

--
This email has not been checked by half-arsed antivirus software