1 # Exim test configuration 2610
3 .include DIR/aux-var/std_conf_prefix
5 primary_hostname = myhost.test.ex
7 # ----- Main settings -----
9 domainlist local_domains = @
10 hostlist relay_hosts = net-mysql;select * from them where id='$sender_host_address'
12 acl_smtp_rcpt = check_recipient
13 acl_not_smtp = check_notsmtp
15 PARTIAL = 127.0.0.1::PORT_N
16 SSPEC = PARTIAL/test/root/pass
17 hide mysql_servers = SSPEC
27 # taint only in lookup string, properly quoted
28 set acl_m0 = ok: ${lookup mysql {select name from them where id = '${quote_mysql:$local_part}'}}
29 # taint only in lookup string, but not quoted
30 set acl_m0 = FAIL1: ${lookup mysql,no_rd {select name from them where id = '$local_part'}}
32 # option on lookup type unaffected
33 set acl_m0 = ok: ${lookup mysql,servers=SSPEC {select name from them where id = '${quote_mysql:$local_part}'}}
34 # partial server-spec, indexing main-option, works
35 set acl_m0 = ok: ${lookup mysql,servers=PARTIAL {select name from them where id = '${quote_mysql:$local_part}'}}
36 # oldstyle server spec, prepended to lookup string, fails with taint
37 set acl_m0 = FAIL2: ${lookup mysql {servers=SSPEC; select name from them where id = '${quote_mysql:$local_part}'}}
38 # oldstyle partial server spec, prepended to lookup string, indexing main-option, but not quoted
39 warn set acl_m0 = FAIL3: ${lookup mysql {servers=PARTIAL; select name from them where id = '$local_part'}}
41 # In list-style lookup, tainted lookup string is ok if server spec comes from main-option
42 warn set acl_m0 = ok: hostlist
43 hosts = net-mysql;select * from them where id='${quote_mysql:$local_part}'
45 # ... but setting a per-query servers spec fails due to the taint
46 warn set acl_m0 = FAIL4: hostlist
47 hosts = <& net-mysql;servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
49 # The newer server-list-as-option-to-lookup-type is not a solution to tainted data in the lookup, because
50 # string-expansion is done before list-expansion so the taint contaminates the entire list.
51 warn set acl_m0 = FAIL5: hostlist
52 hosts = <& net-mysql,servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
54 accept domains = +local_domains
55 # the quoted status of this var should survive being passed via spoolfile
56 set acl_m_qtest = ${quote_mysql:$local_part}
57 accept hosts = +relay_hosts
58 deny message = relay not permitted
62 # the quoted status of this var should survive being passed via spoolfile
63 set acl_m_qtest = ${quote_mysql:$recipients}
71 # this tests that quoting survived being passed via spoolfile
72 debug_print = acl_m_qtest: <$acl_m_qtest> lkup: <${lookup mysql{select name from them where id='$acl_m_qtest'}}>
74 # this tests the unquoted case, but will need enhancement when we enforce (vs. just logging), else no transport call
75 address_data = ${lookup mysql{select name from them where id='$local_part' limit 1}}
79 # ----- Transports -----
85 file = DIR/test-mail/\
86 ${lookup mysql{select id from them where id='$local_part'}{$value}fail}