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}'
44 # ... but setting a per-query servers spec fails due to the taint
45 warn set acl_m0 = FAIL4: hostlist
46 hosts = <& net-mysql;servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
48 # The newer server-list-as-option-to-lookup-type is not a solution to tainted data in the lookup, because
49 # string-expansion is done before list-expansion so the taint contaminates the entire list.
50 warn set acl_m0 = FAIL5: hostlist
51 hosts = <& net-mysql,servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
53 accept domains = +local_domains
54 # the quoted status of this var should survive being passed via spoolfile
55 set acl_m_qtest = ${quote_mysql:$local_part}
56 accept hosts = +relay_hosts
57 deny message = relay not permitted
61 # the quoted status of this var should survive being passed via spoolfile
62 set acl_m_qtest = ${quote_mysql:$recipients}
70 # this tests that quoting survived being passed via spoolfile
71 debug_print = acl_m_qtest: <$acl_m_qtest> lkup: <${lookup mysql{select name from them where id='$acl_m_qtest'}}>
73 # this tests the unquoted case, but will need enhancement when we enforce (vs. just logging), else no transport call
74 address_data = ${lookup mysql{select name from them where id='$local_part' limit 1}}
78 # ----- Transports -----
84 file = DIR/test-mail/\
85 ${lookup mysql{select id from them where id='$local_part'}{$value}fail}