Dear Exim list,
I've got a problem when using a 'if or' with two MySQL lookups.
Situation:
- Manualroute driver for Amavis, with 2 MySQL lookups.
Problem
- When 1 of the 2 MySQL lookups fails, both will fail and the router
will be skipped (ofcourse if the other fail too).
My Amavis-router:
amavis:
driver = manualroute
condition = "${if or {{eq {$interface_port}{10025}} \
{eq {$received_protocol}{spam-scanned}} \
{eq {} {${lookup mysql{SELECT * FROM
smtpotherport WHERE domain='${domain}' AND virusspamscan='1';}}}} \
{eq {} {${lookup mysql{SELECT * FROM spamcheck
WHERE type='a' AND spamcheck='1' AND
receiver='${local_part}@${domain}';}}}} \
{eq {$sender_address}{}} \
}{0}{1}}"
domains = +local_domains
transport = amavis
route_list = "* localhost byname"
self = send
First lookup is for domains which get delivered to another host (and
port). The second one is for our users, who can turn spamscanning on
(spamcheck=1) or off (spamcheck=0)
Is it normal the complete MySQL lookup module fails, when one of the two
fails? Or isn't it allowed to use it within a single router?
When more information is needed, I can add some extra logging etc
(unfortunately I can only do this at my work).
Thanks in advance!
Regards,
Michael Boelen
p.s. Philip: thanks for adding the 'dynamic' port to the `smtp`
transports (although I have yet to change the configuration..)