setup: FreeBSD 9 Stable
Exim version : 4.84
Vexim latest, with local modification that does not interfere with Exim itself
I have run a few tests (both configuration part and result part is given below), and it appears that for some reason the headers_remove -- or more precisely the lookup mysql inside headers_remove -- is not taking more than a certain number of characters as condition.
snippets:
15:45:32 53510 failed to expand: select users.sa_tag * 10 from users,domains where local
15:54:32 54370 failed to expand: select users.sa_tag * 10 from users,domains where local
15:59:39 55092 failed to expand: select users.sa_tag * 10 from users,domains where local
16:04:55 55934 failed to expand: select users.sa_tag * 10 from users,domains where `loca
Please note the last line, where it stopped at the same length.
Thoughts? anyone capable of looking through the code to see if that is the case (I am, by no means, even remotely qualified to do it, otherwise I would have looked it up myself).
Thanks
Shah
Test 01 :: double colons
-------------------------
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} }
Result:
-------
15:45:32 53510 expanding: ${if >{$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}} {X-Spam-Flag: YES\n}{} }
15:45:32 53510������ result: X-Spam-Flag: YES
15:45:32 53510
15:45:32 53510 expanding: $spam_score_int
15:45:32 53510������ result: 27
15:45:32 53510 expanding: 1
15:45:32 53510������ result: 1
15:45:32 53510 expanding: $spam_score_int
15:45:32 53510������ result: 27
15:45:32 53510 failed to expand: select users.sa_tag * 10 from users,domains where local
15:45:32 53510������ error message: missing } at end of string
15:45:32 53510 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:45:32 53510������ error message: missing } at end of string
15:45:32 53510 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:45:32 53510������ error message: missing } at end of string inside "or{...}" condition
15:45:32 53510 virtual_domains router: defer for
postmaster@diagnosis.lan.cps-intl.org15:45:32 53510���� 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,domai
ns 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
============================
Test 02 :: remove mysql_quote
-----------------------------
headers_remove = ${if or { { <{$spam_score_int}{1} } \
������ ������ { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains \
������ ������ where localpart = '{$local_part}' \
������ ������ and domain = '{$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 = '{$local_part}' \
������ ������ and domain = '{$domain}' \
������ ������ and users.on_spamassassin = 0 \
������ ������ and users.domain_id=domains.domain_id}{$value}fail}}} \
������ ������ } {X-Spam-Score::X-Spam-Report} }
Result:
-------
15:54:32 54370 expanding: $spam_score_int
15:54:32 54370������ result: 27
15:54:32 54370 expanding: 1
15:54:32 54370������ result: 1
15:54:32 54370 expanding: $spam_score_int
15:54:32 54370������ result: 27
15:54:32 54370 failed to expand: select users.sa_tag * 10 from users,domains where local
15:54:32 54370������ error message: missing } at end of string
15:54:32 54370 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:54:32 54370������ error message: missing } at end of string
15:54:32 54370 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:54:32 54370������ error message: missing } at end of string inside "or{...}" condition
15:54:32 54370 virtual_domains router: defer for
postmaster@diagnosis.lan.cps-intl.org15:54:32 54370���� 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 = '{$local_part}' and domain = '{$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 = '{$local_part}' and domain = '{$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
============================
Test 03 :: put the variables properly
-------------------------------------
headers_remove = ${if or { { <{$spam_score_int}{1} } \
������ ������ { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains \
������ ������ where localpart = '${local_part}' \
������ ������ and domain = '${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 = '${local_part}' \
������ ������ and domain = '${domain}' \
������ ������ and users.on_spamassassin = 0 \
������ ������ and users.domain_id=domains.domain_id}{$value}fail}}} \
������ ������ } {X-Spam-Score::X-Spam-Report} }
Result:
-------
15:59:39 55092 expanding: $spam_score_int
15:59:39 55092������ result: 27
15:59:39 55092 expanding: 1
15:59:39 55092������ result: 1
15:59:39 55092 expanding: $spam_score_int
15:59:39 55092������ result: 27
15:59:39 55092 failed to expand: select users.sa_tag * 10 from users,domains where local
15:59:39 55092������ error message: missing } at end of string
15:59:39 55092 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:59:39 55092������ error message: missing } at end of string
15:59:39 55092 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains where local
15:59:39 55092������ error message: missing } at end of string inside "or{...}" condition
15:59:39 55092 virtual_domains router: defer for
postmaster@diagnosis.lan.cps-intl.org15:59:39 55092���� 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 = '${local_part}' and domain = '${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 = '${local_part}' and domain = '${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
============================
Test 04 :: tick all the mysql query
-------------------------------------
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} }
Result:
-------
16:04:55 55934 expanding: $spam_score_int
16:04:55 55934������ result: 27
16:04:55 55934 expanding: 1
16:04:55 55934������ result: 1
16:04:55 55934 expanding: $spam_score_int
16:04:55 55934������ result: 27
16:04:55 55934 failed to expand: select users.sa_tag * 10 from users,domains where `loca
16:04:55 55934������ error message: missing } at end of string
16:04:55 55934 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains where `loca
16:04:55 55934������ error message: missing } at end of string
16:04:55 55934 failed to expand: ${if or { { <{$spam_score_int}{1} } { <{$spam_score_int}{${lookup mysql{select users.sa_tag * 10 from users,domains where `loca
16:04:55 55934������ error message: missing } at end of string inside "or{...}" condition
16:04:55 55934 virtual_domains router: defer for
postmaster@diagnosis.lan.cps-intl.org16:04:55 55934���� 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
16:04:55 55934 added retry item for
R:postmaster@diagnosis.lan.cps-intl.org: errno=-1 more_errno=0 flags=0