16:25:07 67108 expanding: ${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}
16:25:07 67108 � �result: 50
16:25:07 67108 condition: >={$acl_m_spamscore}{${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 sers.domain_id=domains.domain_id }{$value}fail}}
16:25:07 67108 � �result: false
16:25:07 67108 expanding: SpamTagText
16:25:07 67108 � �result: SpamTagText
16:25:07 67108 skipping: result is not used
16:25:07 67108 expanding: /etc/exim/exim4u_global_spam_virus
16:25:07 67108 � �result: /etc/exim/exim4u_global_spam_virus
16:25:07 67108 skipping: result is not used
16:25:07 67108 expanding: X-Spam-Flag: YES\nSubject: [${lookup{SpamTagText}lsearch{/etc/exim/exim4u_global_spam_virus}}] $h_Subject:\n
16:25:07 67108 � �result: X-Spam-Flag: YES
16:25:07 67108 Subject: []
16:25:07 67108
16:25:07 67108 skipping: result is not used
16:25:07 67108 expanding: X-Spam-Flag: NO\n
16:25:07 67108 � �result: X-Spam-Flag: NO
16:25:07 67108
16:25:07 67108 expanding: ${if >={$acl_m_spamscore}{${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\nSubject: [${lookup{SpamTagText}lsearch{/etc/exim/exim4u_global_spam_virus}}] $h_Subject:\n}{X-Spam-Flag: NO\n}}
16:25:07 67108 � �result: X-Spam-Flag: NO
16:25:07 67108
16:25:07 67108 expanding: $acl_m_spamscore
16:25:07 67108 � �result:
16:25:07 67108 empty string cast to zero for numerical comparison
16:25:07 67108 failed to expand: select users.sa_tag * 10 from users,domains where localpart = '${quote_mysql
16:25:07 67108 � �error message: "${quote_mysql" is not a known operator (or a } is missing in a variable reference)
16:25:07 67108 failed to expand: ${lookup mysql{select users.sa_tag * 10 from users,domains where localpart = '${quote_mysql
16:25:07 67108 � �error message: "${quote_mysql" is not a known operator (or a } is missing in a variable reference)
16:25:07 67108 failed to expand: ${if >={$acl_m_spamscore}{${lookup mysql{select users.sa_tag * 10 from users,domains where localpart = '${quote_
mysql
16:25:07 67108 � �error message: "${quote_mysql" is not a known operator (or a } is missing in a variable reference)
16:25:07 67108 virtual_domains router: defer for XXXX@Domain.name
16:25:07 67108 � message: virtual_domains router failed to expand "${if >={$acl_m_spamscore}{${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=d
omains.domain_id }{$value}fail}} {Subject}{${if eq{SPAMHEADERTYPE}{0}{X-Spam-Report}}} �}": "${quote_mysql" is not a known operator (or a } is missing in a variable reference)
This is an issue directly from virtual_domains router and exactly from the headers_remove part:
# exim4u: This router routes to virtual domains with spamassassin filtering
virtual_domains:
� condition = �${if < {SPAMREJECT}{1000}}
� driver = redirect
� allow_fail
� data = ${lookup mysql{select smtp from users,domains \
� � � � � � � � where localpart = '${quote_mysql:$local_part}' \
� � � � � � � � and domain = '${quote_mysql:$domain}' \
� � � � � � � � and domains.enabled = '1' \
� � � � � � � � and users.enabled = '1' \
� � � � � � � � and users.domain_id = domains.domain_id}}
# exim4u header_remove to remove subject if spam or X-Spam-Report if not spam and SPAMHEADERTYPE=0.
� headers_remove = ${if >={$acl_m_spamscore}{${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}} \
� � � � � � � � {Subject}{${if eq{SPAMHEADERTYPE}{0}{X-Spam-Report}}} �\
� � � � � � � � }
# exim4u header_add to add X-Spam-Flag for all mail and rewrite Subject if spam.
� headers_add = ${if >={$acl_m_spamscore}{${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\nSubject: [SPAMTAGTEXT] $h_Subject:\n}{X-Spam-Flag: NO\n}\
� � � � � � � � }
# local_part_suffix = -*
# local_part_suffix_optional
� retry_use_local_part
# file_transport = virtual_delivery
� file_transport = dovecot_virtual_delivery
� reply_transport = address_reply
� pipe_transport = address_pipe
So, Gordon, can you possibly take a look at the query again to see where you can introduce improvements.
Given that Jeremy Harris did some work around this portion, I have taken the liberty to request for his input on the same. He is not subscribed to this list and might get really pissed off, or this mail might end up as spam, but let me try:)
PS: Jeremy, I hope I don't piss you off with this. Please advise us on what's wrong with our headers_remove query since Exim-4.8{3|4} and thank you in advance.