Re: [exim] Issues with headers_remove in router ::

Góra strony
Delete this message
Reply to this message
Autor: Shamim Shahriar
Data:  
Dla: Jeremy Harris
CC: exim-users
Temat: Re: [exim] Issues with headers_remove in router ::
Thanks Jeremy, I revisited the conditions, and once I got rid of all the
text inside the brackets, this is what the barebone version comes to

${if or
       {
          { <{ } { } } \
          { <{ }{ ${mysql{ '${}' '${}' }{} }} } \
          { {0}{${mysql{ '${}' '${}' }{} }}} \
       } {X-Spam-Score::X-Spam-Report}
}


As you can see, there is a closing bracket right before the if-result,
which is against the "or{". Also, the three conditions inside OR { } does
begin and close where expected.

However, in order to make sure that I am not miscalculating, I added one }
right where you pointed, and below are the results

07:49:13 24368 failed to expand: select users.sa_tag * 10 from
users,domains where local
07:49:13 24368    error message: missing } at end of string
07:49:13 24368 failed to expand: ${lookup mysql{select users.sa_tag * 10
from users,domains where local
07:49:13 24368    error message: missing } at end of string
07:49:13 24368 failed to expand: ${if or { { <{$spam_score_int}{1} } {
<{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from
users,domains where local
07:49:13 24368    error message: missing } at end of string inside
"or{...}" condition
07:49:13 24368 virtual_domains router: defer for postmaster@???
07:49:13 24368   message: virtual_domains router failed to expand "${if or
{ { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select
users.sa_tag * 10 from users,domains where localpart =
'${quote_mysql::$local_part}' and domain = '${quote_mysql::$domain}' and
users.on_spamassassin = 1 and
users.domain_id=domains.domain_id}{$value}fail}} } { eq {0}{${lookup
mysql{select users.sa_tag * 10 from users,domains where localpart =
'${quote_mysql::$local_part}' and domain = '${quote_mysql::$domain}' and
users.on_spamassassin = 0 and
users.domain_id=domains.domain_id}{$value}fail}}} }     }
{X-Spam-Score::X-Spam-Report} }": missing } at end of string inside
"or{...}" condition



As it seems, it is still thinking there is one missing curly bracket.
Strange!

Any other thoughts?

Thanks again for your help.

Regards
Shah


On 5 September 2014 12:37, Jeremy Harris <jgh@???> wrote:

> On 05/09/14 12:10, Shamim Shahriar wrote:
> > Hello Jeremy
> >
> > Thank you for your reply. I tried that, and below is the modified
> > headers_remove section
> >
> >   headers_remove = ${if or { { <{$spam_score_int}{1} } \
> >         { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from
> > users,domains \
> >         where localpart = '${quote_mysql::$local_part}' \
> >         and domain = '${quote_mysql::$domain}' \
> >         and users.on_spamassassin = 1 \
> >         and users.domain_id=domains.domain_id}{$value}fail}} } \
> >         { eq {0}{${lookup mysql{select users.sa_tag * 10 from
> users,domains
> > \
> >         where localpart = '${quote_mysql::$local_part}' \
> >         and domain = '${quote_mysql::$domain}' \
> >         and users.on_spamassassin = 0 \
> >         and users.domain_id=domains.domain_id}{$value}fail}}} \
> >         } {X-Spam-Score::X-Spam-Report} }

>
> If I'm counting brackets right, you have
>
>  {if
>    or {    { cond1 }
>            { cond2 }
>            { cond3 }

>
>                               <<<<<<<<<< MISSING

>
> { if-result }
>
> }
>
> --
> Cheers,
> Jeremy
>
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>