my last diagnosis report SA_Query = select sa_tag from users limit 1; headers_remove = ${if or{{<{2}{1}} \ { eq {0}{${lookup mysql{SA_Query}{$value}fail}}} \ }{X-Spam-Score::X-Spam-Report}} and it is working. Please note, the changes from the previous non-working one is the removal of spaces between the curly brackets -- i.e., shortening the length of the conditions. i.e., same condition with larger string-length fails. Could someone please check and let me know if I have missed something very obvious then that will be greatly appreciated. Thanks all Shah On 26 September 2014 09:56, Shamim Shahriar <shamim.shahriar(a)gmail.com> wrote:
Hello All
now I am even more convinced that it is not just the "lookup mysql", but the entire headers_remove is suffering. Please find below the changes I made and the results I received.
Thanks Shah
----
change: SA_Query = select sa_tag from users limit 1
result: 09:30:08 17194 expanding: ${lookup mysql{select sa_tag from users limit 1}{$value}fail} 09:30:08 17194 result: 2 09:30:08 17194 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select sa_tag from users limit 1}{$value}fail}} } { eq 09:30:08 17194 error message: missing { after "eq" inside "or{...}" condition
change: SA_Query = select sa_tag from users limit 1;
result: 09:35:35 17922 expanding: ${lookup mysql{select sa_tag from users limit 1;}{$value}fail} 09:35:35 17922 result: 2 09:35:35 17922 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select sa_tag from users limit 1;}{$value}fail}} } { eq 09:35:35 17922 error message: missing { after "eq" inside "or{...}" condition
changed headers_remove to as below keep the SA_Query as above: headers_remove = ${if or { { <{$spam_score_int}{1} } \ { <{$spam_score_int}{${lookup mysql{SA_Query}{$value}fail}} } \ } {X-Spam-Score:X-Spam-Report} }
result: 09:43:51 18778 expanding: ${lookup mysql{select sa_tag from users limit 1;}{$value}fail} 09:43:51 18778 result: 2 09:43:51 18778 condition: or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select sa_tag from users limit 1;}{$value}fail}} } } 09:43:51 18778 result: false 09:43:51 18778 failed to expand: X 09:43:51 18778 error message: missing } at end of string 09:43:51 18778 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select sa_tag from users limit 1;}{$value}fail}} } } {X 09:43:51 18778 error message: missing } at end of string
changed headers_remove to as below keep the SA_Query as above: headers_remove = ${if or { { <{$spam_score_int}{1} } \ { eq {0}{${lookup mysql{SA_Query}{$value}fail}}} \ } {X-Spam-Score:X-Spam-Report} }
result: 09:49:35 19577 expanding: ${lookup mysql{select sa_tag from users limit 1;}{$value}fail} 09:49:35 19577 result: 2 09:49:35 19577 condition: or { { <{$spam_score_int}{1} } { eq {0}{${lookup mysql{select sa_tag from users limit 1;}{$value}fail}}} } 09:49:35 19577 result: false 09:49:35 19577 failed to expand: X-Spam-Score 09:49:35 19577 error message: missing } at end of string 09:49:35 19577 failed to expand: ${if or { { <{$spam_score_int}{1} } { eq {0}{${lookup mysql{select sa_tag from users limit 1;}{$value}fail}}} } {X-Spam-Score 09:49:35 19577 error message: missing } at end of string
On 25 September 2014 23:49, Shamim Shahriar <shamim.shahriar(a)gmail.com> wrote:
On 25/09/2014 23:17, Shamim Shahriar wrote:
On 25/09/2014 19:14, Rimas Kudelis wrote:
Hi folks, this would make sense. It would explain why regardless of the number of closing braces you'd add, the condition fails. Just to make sure that it's not just logs where the cropping occurs, could you find a working condition and break it by introducing some random whitespace or other useless chars in it?
Rimas, you wanted to see a length change factor, sorry I forgot to add this bit.
With SA_Query = select users.sa_tag * 10 from users,domains ;
the error is 22:48:49 16989 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains ;}{$value}f
and with SA_Query = select users.sa_tag * 10 from users,domains (the line literally ends at the last s)
the error is 23:06:44 19963 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains}{$value}fai
putting them together, I'd say they do exhibit the symptoms of length issues
23:06:44 19963 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains}{$value}fai 22:48:49 16989 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains ;}{$value}f
And then, I changed it to something even shorter SA_Query = select users.sa_tag from users,domains
and that expanded to 23:30:13 23669 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select users.sa_tag from users,domains}{$value}fail}} } 23:30:13 23669 error message: invalid integer "2
which indicates that the query part of it *did* work out (even though the result did not have any meaning, but the 'select' part worked) when it was shortened to an impractical (IMHO) length. I cannot think of any practical/functional query that I can fit in this short length -- but then again, I am not a sql expert, maybe someone with a better knowledge can fit that long query into this smaller space -- but I surely cannot.
Does is help in what you are looking for?
I need to turn in now. All the best Shah