[exim] Weird errors with conditions

Top Pagina
Delete this message
Reply to this message
Auteur: Yves Goergen
Datum:  
Aan: Exim-users list
Onderwerp: [exim] Weird errors with conditions
Hi,
can someone please tell me how Exim conditions work?

Here's what I tried:
> condition = ${if {and {{eq{$recipients_count}{1}} {${lookup mysql{MYSQL_Q_SPAMFILTER}{$value}fail}}}} {true}}


And here's what I got in the log (amongst others):
> temporarily rejected after DATA: failed to expand ACL string "${if {and {{eq{$recipients_count}{1}} {${lookup mysql{SELECT spamfilter FROM users WHERE CONCAT(local, "@", domain)='${quote_mysql:$recipients}' LIMIT 1}{$value}fail}}}} {true}}": condition name expected, but found "{and {{eq{$recip"
> temporarily rejected after DATA: failed to expand ACL string "${if and {{eq{$recipients_count}{1}} ${lookup mysql{SELECT spamfilter FROM users WHERE CONCAT(local, "@", domain)='${quote_mysql:$recipients}' LIMIT 1}{$value}fail}} {true}}": each subcondition inside an "and{...}" condition must be in its own {}
> temporarily rejected after DATA: failed to expand ACL string "${if and{{eq{$recipients_count}{1}}{${lookup mysql{SELECT spamfilter FROM users WHERE CONCAT(local, "@", domain)='${quote_mysql:$recipients}' LIMIT 1}{$value}fail}}}{true}}": condition name expected, but found "${lookup mysql{S" inside "and{...}" condition
> temporarily rejected after DATA: failed to expand ACL string "${if and{{eq{$recipients_count}{1}{true}{false}}{${lookup mysql{SELECT spamfilter FROM users WHERE CONCAT(local, "@", domain)='${quote_mysql:$recipients}' LIMIT 1}{$value}fail}}}}": missing } at end of condition inside "and" group


Well, I can't get it working. And yes, I have read the Exim docs, but
there's no working example in them so I have no idea what that all means. :(

Here's what I do want to do:
> if ($recipients_count == 1 && lookup_mysql(MYSQL_Q_SPAMFILTER))
>     return true
> else
>     return fail /*or false or whatever untrue*/


Why can't I use C-like syntax in the Exim config file? All those
{{{}{}{}}{ all around make me go insane one day...

I'm going to use this condition at multiple places for now, to check if
there's a single recipient of the mail and if so, is the content filter
enabled for this user. Then attachment, spam and other checks will be run.

--
Yves Goergen "LonelyPixel" <nospam.list@???>
"People think I've stopped lying... but I've just gotten better at it."
http://newsboard.unclassified.de - Unclassified NewsBoard Forum