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

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Heiko Schlittermann
Datum:  
To: exim-users
Betreff: Re: [exim] Bug in string expansion of exim configuration?
Hi,

Forum <forum@???> (Do 22 Dez 2016 10:27:01 CET):
> Hello exim developers,
> must i write to the exim-dev mailing list?


It depends…

> 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!
> 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?


Syntax is correct, but not the idea behind. In the DATA ACL you can't
use $local_part, $domain, since you may have multiple recipients.

Though there is some $recipients variable, you can iterate through. But,
you can't use the results, as in the DATA ACL you reject or accept the
*message* for all recipients only. Not for a single recipient.

You can offer PRDR and the acl_smtp_data_prdr, to return different
responses for different recipients. But you can't rely on the sending
client to support PRDR.

For clients not supporting PRDR you can single out every recipient after
the first, using $recipients_count and defer. After this you're sure,
that your DATA ACL needs to care about a single recipient only.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -