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
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 = FAIL: ${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 = FAIL: ${lookup mysql {servers=SSPEC; select name from them where id = '${quote_mysql:$local_part}'}}
39 # In list-style lookup, tainted lookup string is ok if server spec comes from main-option
40 warn set acl_m0 = ok: hostlist
41 hosts = net-mysql;select * from them where id='${quote_mysql:$local_part}'
42 # ... but setting a per-query servers spec fails due to the taint
43 warn set acl_m0 = FAIL: hostlist
44 hosts = <& net-mysql;servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
46 # The newer server-list-as-option-to-lookup-type is not a solution to tainted data in the lookup, because
47 # string-expansion is done before list-expansion so the taint contaminates the entire list.
48 warn set acl_m0 = FAIL: hostlist
49 hosts = <& net-mysql,servers=SSPEC; select * from them where id='${quote_mysql:$local_part}'
51 accept domains = +local_domains
52 # the quoted status of this var should survive being passed via spoolfile
53 set acl_m_qtest = ${quote_mysql:$local_part}
54 accept hosts = +relay_hosts
55 deny message = relay not permitted
59 # the quoted status of this var should survive being passed via spoolfile
60 set acl_m_qtest = ${quote_mysql:$recipients}
68 debug_print = acl_m_qtest: <$acl_m_qtest> lkup: <${lookup mysql{select name from them where id='$acl_m_qtest'}}>
70 # this tests the unquoted case, but will need enhancement when we enforce (vs. just logging), else no transport call
71 address_data = ${lookup mysql{select name from them where id='$local_part'}}
75 # ----- Transports -----
81 file = DIR/test-mail/\
82 ${lookup mysql{select id from them where id='$local_part'}{$value}fail}