[exim] condition problem in routers

Pàgina inicial
Delete this message
Reply to this message
Autor: Wakko Warner
Data:  
A: exim-users
Assumpte: [exim] condition problem in routers
Please keep me CCd.
exim v4.64

I have the following router on one of my mail servers:
auto_whitelist:
        driver = redirect
        domains = !+local_domains
        sender_domains = +local_domains
        condition = no${lookup mysql{SELECT 'no' \
                                        FROM lists.auto_whitelist \
                                        WHERE sender='$sender_address_local_part' AND \
                                                recipient='${quote_mysql:$local_part}@$domain' \
                                        LIMIT 1 \
                                  } \
                             {} \
                             {${lookup mysql{REPLACE INTO lists.auto_whitelist \
                                                (sender, recipient) \
                                                VALUES ('$sender_address_local_part', \
                                                        '${quote_mysql:$local_part}@$domain') \
                                            } \
                                            {} \
                                            {} \
                               } \
                             } \
                     }
        data = :blackhole:
        unseen
        no_verify
        no_expn
        no_address_test


The only reason for this is to add data to a database at routing time.
condition is always "no" so it should never work, unfortunately, it runs only
if the SELECT statement returns any data. What's even worse is that unseen
is not honoured.

The entire ${lookup is not supposed to return anything.

If I comment out the lookup part, it works as expected.

If I comment out the inner ${lookup (the one that does the REPLACE INTO), it
also works as expected.

If I change :blackhole: to :defer:, it works as expected.

Any one have any ideas on this?

Here's the exim -d+expand on sending an email. Only the auto_whitelist
router is listed (note, the email address has been modified from wakko@ to
wakko#)

--------> auto_whitelist router <--------
local_part=wakko domain=animx.eu.org
checking domains
expanding: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
result: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' " partial=-1 affix=NULL
starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' "
cached data used for lookup of SELECT GROUP_CONCAT(domain SEPARATOR ' : ')
FROM eximconf.localdomains WHERE enabled='yes'
lookup yielded: electro-mechanical.com : federalpacific.com : linepower.com
: fptonline.com : metalcastingsco.com : thereserveatleonardfarms.com
expanding: localhost : /etc/exim4/localdomains : ${lookup mysql{SELECT
GROUP_CONCAT(domain SEPARATOR ' : ') FROM eximconf.localdomains WHERE
enabled='yes' } }
result: localhost : /etc/exim4/localdomains : electro-mechanical.com :
federalpacific.com : linepower.com : fptonline.com : metalcastingsco.com :
thereserveatleonardfarms.com
animx.eu.org in "localhost : /etc/exim4/localdomains :
electro-mechanical.com : federalpacific.com : linepower.com : fptonline.com
: metalcastingsco.com : thereserveatleonardfarms.com"? no (end of list)
animx.eu.org in "!+local_domains"? yes (end of list)
checking sender_domains
expanding: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
result: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' " partial=-1 affix=NULL
starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' "
cached data used for lookup of SELECT GROUP_CONCAT(domain SEPARATOR ' : ')
FROM eximconf.localdomains WHERE enabled='yes'
lookup yielded: electro-mechanical.com : federalpacific.com : linepower.com
: fptonline.com : metalcastingsco.com : thereserveatleonardfarms.com
expanding: localhost : /etc/exim4/localdomains : ${lookup mysql{SELECT
GROUP_CONCAT(domain SEPARATOR ' : ') FROM eximconf.localdomains WHERE
enabled='yes' } }
result: localhost : /etc/exim4/localdomains : electro-mechanical.com :
federalpacific.com : linepower.com : fptonline.com : metalcastingsco.com :
thereserveatleonardfarms.com
electro-mechanical.com in "localhost : /etc/exim4/localdomains :
electro-mechanical.com : federalpacific.com : linepower.com : fptonline.com
: metalcastingsco.com : thereserveatleonardfarms.com"? yes (matched
"electro-mechanical.com")
electro-mechanical.com in "+local_domains"? yes (matched "+local_domains")
checking "condition"
expanding: $local_part
result: wakko
expanding: SELECT 'no' FROM lists.auto_whitelist WHERE
sender='$sender_address_local_part' AND
recipient='${quote_mysql:$local_part}@$domain' LIMIT 1
result: SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1 " partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT 'no' FROM lists.auto_whitelist WHERE sender='root'
AND recipient='wakko#animx.eu.org' LIMIT 1 "
database lookup required for SELECT 'no' FROM lists.auto_whitelist WHERE
sender='root' AND recipient='wakko#animx.eu.org' LIMIT 1
MYSQL query: SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1
MYSQL using cached connection for /eximconf/exim
MYSQL: no data found
lookup failed
expanding:
result:
skipping: result is not used
expanding: $local_part
result: wakko
expanding: REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('$sender_address_local_part', '${quote_mysql:$local_part}@$domain')
result: REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('root', 'wakko#animx.eu.org')
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES ('root',
'wakko#animx.eu.org') " partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="REPLACE INTO lists.auto_whitelist (sender, recipient)
VALUES ('root', 'wakko#animx.eu.org') "
database lookup required for REPLACE INTO lists.auto_whitelist (sender,
recipient) VALUES ('root', 'wakko#animx.eu.org')
MYSQL query: REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('root', 'wakko#animx.eu.org')
MYSQL using cached connection for /eximconf/exim
MYSQL: query was not one that returns data
lookup forced cache cleanup
lookup yielded: 1
expanding:
result:
expanding:
result:
skipping: result is not used
expanding: ${lookup mysql{REPLACE INTO lists.auto_whitelist (sender,
recipient) VALUES ('$sender_address_local_part',
'${quote_mysql:$local_part}@$domain') } {} {} }
result:
expanding: no${lookup mysql{SELECT 'no' FROM lists.auto_whitelist WHERE
sender='$sender_address_local_part' AND
recipient='${quote_mysql:$local_part}@$domain' LIMIT 1 } {} {${lookup
mysql{REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('$sender_address_local_part', '${quote_mysql:$local_part}@$domain') } {} {}
} } }
result: no
calling auto_whitelist router
rda_interpret (string): :blackhole:
expanded: :blackhole:
file is not a filter file
parse_forward_list: :blackhole:
extract item: :blackhole:
address :blackhole:d
LOG: MAIN
=> :blackhole: <wakko#animx.eu.org> R=auto_whitelist


With :defer:
local_part=wakko domain=animx.eu.org
checking domains
expanding: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
result: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' " partial=-1 affix=NULL
starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' "
cached data used for lookup of SELECT GROUP_CONCAT(domain SEPARATOR ' : ')
FROM eximconf.localdomains WHERE enabled='yes'
lookup yielded: electro-mechanical.com : federalpacific.com : linepower.com
: fptonline.com : metalcastingsco.com : thereserveatleonardfarms.com
expanding: localhost : /etc/exim4/localdomains : ${lookup mysql{SELECT
GROUP_CONCAT(domain SEPARATOR ' : ') FROM eximconf.localdomains WHERE
enabled='yes' } }
result: localhost : /etc/exim4/localdomains : electro-mechanical.com :
federalpacific.com : linepower.com : fptonline.com : metalcastingsco.com :
thereserveatleonardfarms.com
animx.eu.org in "localhost : /etc/exim4/localdomains :
electro-mechanical.com : federalpacific.com : linepower.com : fptonline.com
: metalcastingsco.com : thereserveatleonardfarms.com"? no (end of list)
animx.eu.org in "!+local_domains"? yes (end of list)
checking sender_domains
expanding: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
result: SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes'
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' " partial=-1 affix=NULL
starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT GROUP_CONCAT(domain SEPARATOR ' : ') FROM
eximconf.localdomains WHERE enabled='yes' "
cached data used for lookup of SELECT GROUP_CONCAT(domain SEPARATOR ' : ')
FROM eximconf.localdomains WHERE enabled='yes'
lookup yielded: electro-mechanical.com : federalpacific.com : linepower.com
: fptonline.com : metalcastingsco.com : thereserveatleonardfarms.com
expanding: localhost : /etc/exim4/localdomains : ${lookup mysql{SELECT
GROUP_CONCAT(domain SEPARATOR ' : ') FROM eximconf.localdomains WHERE
enabled='yes' } }
result: localhost : /etc/exim4/localdomains : electro-mechanical.com :
federalpacific.com : linepower.com : fptonline.com : metalcastingsco.com :
thereserveatleonardfarms.com
electro-mechanical.com in "localhost : /etc/exim4/localdomains :
electro-mechanical.com : federalpacific.com : linepower.com : fptonline.com
: metalcastingsco.com : thereserveatleonardfarms.com"? yes (matched
"electro-mechanical.com")
electro-mechanical.com in "+local_domains"? yes (matched "+local_domains")
checking "condition"
expanding: $local_part
result: wakko
expanding: SELECT 'no' FROM lists.auto_whitelist WHERE
sender='$sender_address_local_part' AND
recipient='${quote_mysql:$local_part}@$domain' LIMIT 1
result: SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1 " partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT 'no' FROM lists.auto_whitelist WHERE sender='root'
AND recipient='wakko#animx.eu.org' LIMIT 1 "
database lookup required for SELECT 'no' FROM lists.auto_whitelist WHERE
sender='root' AND recipient='wakko#animx.eu.org' LIMIT 1
MYSQL query: SELECT 'no' FROM lists.auto_whitelist WHERE sender='root' AND
recipient='wakko#animx.eu.org' LIMIT 1
MYSQL using cached connection for /eximconf/exim
lookup yielded: no
expanding:
result:
expanding: $local_part
result:
skipping: result is not used
expanding: REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('$sender_address_local_part', '${quote_mysql:$local_part}@$domain')
result: REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES ('',
'@')
skipping: result is not used
expanding:
result:
skipping: result is not used
expanding:
result:
skipping: result is not used
expanding: ${lookup mysql{REPLACE INTO lists.auto_whitelist (sender,
recipient) VALUES ('$sender_address_local_part',
'${quote_mysql:$local_part}@$domain') } {} {} }
result:
skipping: result is not used
expanding: no${lookup mysql{SELECT 'no' FROM lists.auto_whitelist WHERE
sender='$sender_address_local_part' AND
recipient='${quote_mysql:$local_part}@$domain' LIMIT 1 } {} {${lookup
mysql{REPLACE INTO lists.auto_whitelist (sender, recipient) VALUES
('$sender_address_local_part', '${quote_mysql:$local_part}@$domain') } {} {}
} } }
result: no
auto_whitelist router skipped: condition failure


--
Lab tests show that use of micro$oft causes cancer in lab animals
Got Gas???