+.new
+.section "Results of list checking" SECTlistresults
+The primary result of doing a list check is a truth value.
+In some contexts additional information is stored
+about the list element that matched:
+.vlist
+.vitem hosts
+A &%hosts%& ACL condition
+will store a result in the &$host_data$& variable.
+.vitem local_parts
+A &%local_parts%& router option or &%local_parts%& ACL condition
+will store a result in the &$local_part_data$& variable.
+.vitem domains
+A &%domains%& router option or &%domains%& ACL condition
+.vitem senders
+A &%senders%& router option or &%senders%& ACL condition
+will store a result in the &$sender_data$& variable.
+.vitem recipients
+A &%recipients%& ACL condition
+will store a result in the &$recipient_data$& variable.
+.endlist
+
+The detail of the additional information depends on the
+type of match and is given below as the &*value*& information.
+.wen
+
+
+
+
.section "Named lists" "SECTnamedlists"
.cindex "named lists"
.cindex "list" "named"
as set by the &%primary_hostname%& option (or defaulted). This makes it
possible to use the same configuration file on several different hosts that
differ only in their names.
+
+.new
+The value for a match will be the primary host name/
+.wen
+
+
.next
.cindex "@[] in a domain list"
.cindex "domain list" "matching local IP interfaces"
&%local_interfaces%& and &%extra_local_interfaces%& options can be used to
control which of a host's several IP addresses are treated as local.
In today's Internet, the use of domain literals is controversial.
+
+.new
+The value for a match will be the &`@[]`& string.
+.wen
+
+
.next
.cindex "@mx_any"
.cindex "@mx_primary"
domains = <? @mx_any/ignore=<;127.0.0.1;::1 ? \
an.other.domain ? ...
.endd
+.new
+The value for a match will be the list element string (starting &`@mx_`&).
+.wen
+
+
.next
.cindex "asterisk" "in domain list"
.cindex "domain list" "asterisk in"
list item such as &`*key.ex`& matches &'donkey.ex'& as well as
&'cipher.key.ex'&.
+.new
+The value for a match will be the list element string (starting with the asterisk).
+.wen
+
.next
.cindex "regular expressions" "in domain list"
.cindex "domain list" "matching regular expression"
use the special &`\N`& sequence (see chapter &<<CHAPexpand>>&) to specify that
it is not to be expanded (unless you really do want to build a regular
expression by expansion, of course).
+
+.new
+The value for a match will be the list element string (starting with the circumflex).
+.wen
+
+
+
.next
.cindex "lookup" "in domain list"
.cindex "domain list" "matching by lookup"
domains = cdb;/etc/mail/local_domains.cdb
.endd
The appropriate type of lookup is done on the file using the domain name as the
-key. In most cases, the data that is looked up is not used; Exim is interested
+key. In most cases, the value resulting from the lookup is not used; Exim is interested
only in whether or not the key is present in the file. However, when a lookup
is used for the &%domains%& option on a router
-or a &%domains%& condition in an ACL statement, the data is preserved in the
+or a &%domains%& condition in an ACL statement, the value is preserved in the
&$domain_data$& variable and can be referred to in other router options or
other statements in the same ACL.
+.cindex "tainted data" "de-tainting"
+The value will be untainted.
+
.next
Any of the single-key lookup type names may be preceded by
select particular domains (because any domain would match), but it might have
value if the result of the lookup is being used via the &$domain_data$&
expansion variable.
+
.next
If the pattern starts with the name of a query-style lookup type followed by a
semicolon (for example, &"nisplus;"& or &"ldap;"&), the remainder of the
hold_domains = mysql;select domain from holdlist \
where domain = '${quote_mysql:$domain}';
.endd
-In most cases, the data that is looked up is not used (so for an SQL query, for
+In most cases, the value resulting from the lookup is not used (so for an SQL query, for
example, it doesn't matter what field you select). Exim is interested only in
whether or not the query succeeds. However, when a lookup is used for the
-&%domains%& option on a router, the data is preserved in the &$domain_data$&
+&%domains%& option on a router, the value is preserved in the &$domain_data$&
variable and can be referred to in other options.
+.cindex "tainted data" "de-tainting"
+The value will be untainted.
+
.next
.new
If the pattern starts with the name of a lookup type
of either kind (single-key or query-style) it may be
-followed by a command and options,
+followed by a comma and options,
The options are lookup-type specific and consist of a comma-separated list.
Each item starts with a tag and and equals "=".
.wen
+
.next
.cindex "domain list" "matching literal domain name"
If none of the above cases apply, a caseless textual comparison is made
between the pattern and the domain.
+
+The value for a match will be the list element string.
+.cindex "tainted data" "de-tainting"
+Note that this is commonly untainted
+(depending on the way the list was created).
+This is a useful way of obtaining an untainted equivalent to
+the domain, for later operations.
.endlist
+
Here is an example that uses several different kinds of pattern:
.code
domainlist funny_domains = \
/*
XXX looks like $0 may be usable
-XXX could add setting of *valueptr to all the OK returns; seems doable here, the Q
- is: what effect would it have at config-file level. domain_data & local_part_data
- would get filled in... might anyone be checking it for emptiness? I think the docs
- do not say "will be empty otherwise", so that seems ok.
-XXX WORRY: we get new caching of named-list match results. Is that cache checked
- for the key being matched?
*/
}
nb->cache_data = p;
if (*valueptr)
DEBUG(D_lists) debug_printf("data from lookup saved for "
- "cache for %s: %s\n", ss, *valueptr);
+ "cache for %s: key '%s' value '%s'\n", ss, p->key, *valueptr);
}
}
}
else
{
DEBUG(D_lists) debug_printf("cached %s match for %s\n",
- ((bits & (-bits)) == bits)? "yes" : "no", ss);
+ (bits & (-bits)) == bits ? "yes" : "no", ss);
cached = US" - cached";
if (valueptr)
address match test: subject=ok@test1 pattern=ok@test1
test1 in "test1"? yes (matched "test1")
ok@test1 in "ok@somewhere : ok@test1 : ok@test3"? yes (matched "ok@test1")
-data from lookup saved for cache for +ok_senders: test1
+data from lookup saved for cache for +ok_senders: key 'ok@test1' value 'test1'
ok@test1 in "+ok_senders"? yes (matched "+ok_senders")
check sender_domains = +ok_sender_domains
test1 in "somewhere : test1 : test3"? yes (matched "test1")
address match test: subject=ok@test3 pattern=ok@test3
test3 in "test3"? yes (matched "test3")
ok@test3 in "ok@somewhere : ok@test1 : ok@test3"? yes (matched "ok@test3")
-data from lookup saved for cache for +ok_senders: test3
+data from lookup saved for cache for +ok_senders: key 'ok@test3' value 'test3'
ok@test3 in "+ok_senders"? yes (matched "+ok_senders")
check sender_domains = +ok_sender_domains
test3 in "somewhere : test1 : test3"? yes (matched "test3")
local_part=x domain=test.ex
checking domains
test.ex in "test.ex : myhost.test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "! +local_domains"? no (matched "! +local_domains")
fail_remote_domains router skipped: domains mismatch
--------> smart2 router <--------
local_part=x domain=myhost.test.ex
checking domains
myhost.test.ex in "test.ex : myhost.test.ex"? yes (matched "myhost.test.ex")
-data from lookup saved for cache for +local_domains: myhost.test.ex
+data from lookup saved for cache for +local_domains: key 'myhost.test.ex' value 'myhost.test.ex'
myhost.test.ex in "! +local_domains"? no (matched "! +local_domains")
fail_remote_domains router skipped: domains mismatch
--------> smart2 router <--------
local_part=x domain=test.ex
checking domains
test.ex in "test.ex : myhost.test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "! +local_domains"? no (matched "! +local_domains")
fail_remote_domains router skipped: domains mismatch
--------> smart2 router <--------
local_part=x domain=myhost.test.ex
checking domains
myhost.test.ex in "test.ex : myhost.test.ex"? yes (matched "myhost.test.ex")
-data from lookup saved for cache for +local_domains: myhost.test.ex
+data from lookup saved for cache for +local_domains: key 'myhost.test.ex' value 'myhost.test.ex'
myhost.test.ex in "! +local_domains"? no (matched "! +local_domains")
fail_remote_domains router skipped: domains mismatch
--------> smart2 router <--------
processing "accept" (TESTSUITE/test-config 31)
check domains = +local_domains
test.ex in "test.ex : *.test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "+local_domains"? yes (matched "+local_domains")
accept: condition test succeeded in ACL "check_recipient"
end of ACL "check_recipient": ACCEPT
processing "accept" (TESTSUITE/test-config 24)
check domains = +local_domains
test.ex in "test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "+local_domains"? yes (matched "+local_domains")
accept: condition test succeeded in ACL "check_recipient"
end of ACL "check_recipient": ACCEPT
test.ex in "never.ex"? no (end of list)
test.ex in "never1.ex"? no (end of list)
test.ex in "test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "+never_domains : +n1_domains : ! +local_domains"? no (matched "! +local_domains")
r1 router skipped: domains mismatch
--------> r2 router <--------
test.ex in "never.ex"? no (end of list)
test.ex in "never1.ex"? no (end of list)
test.ex in "test.ex"? yes (matched "test.ex")
-data from lookup saved for cache for +local_domains: test.ex
+data from lookup saved for cache for +local_domains: key 'test.ex' value 'test.ex'
test.ex in "+never_domains : +n1_domains : ! +local_domains"? no (matched "! +local_domains")
r1 router skipped: domains mismatch
--------> r2 router <--------
CALLER in "never"? no (end of list)
CALLER in "never1"? no (end of list)
CALLER in "CALLER"? yes (matched "CALLER")
-data from lookup saved for cache for +local_localparts: CALLER
+data from lookup saved for cache for +local_localparts: key 'CALLER' value 'CALLER'
CALLER in "+never_localparts : +n1_localparts : ! +local_localparts"? no (matched "! +local_localparts")
r1 router skipped: local_parts mismatch
--------> r2 router <--------
CALLER in "never"? no (end of list)
CALLER in "never1"? no (end of list)
CALLER in "CALLER"? yes (matched "CALLER")
-data from lookup saved for cache for +local_localparts: CALLER
+data from lookup saved for cache for +local_localparts: key 'CALLER' value 'CALLER'
CALLER in "+never_localparts : +n1_localparts : ! +local_localparts"? no (matched "! +local_localparts")
r1 router skipped: local_parts mismatch
--------> r2 router <--------
address match test: subject=CALLER@test.ex pattern=CALLER@test.ex
test.ex in "test.ex"? yes (matched "test.ex")
CALLER@test.ex in "CALLER@test.ex"? yes (matched "CALLER@test.ex")
-data from lookup saved for cache for +local_addresses: test.ex
+data from lookup saved for cache for +local_addresses: key 'CALLER@test.ex' value 'test.ex'
CALLER@test.ex in "+never_addresses : +n1_addresses : ! +local_addresses"? no (matched "! +local_addresses")
r1 router skipped: senders mismatch
--------> r2 router <--------
processing "accept" (TESTSUITE/test-config 23)
check domains = +relay_domains
a.b.c in "a.b.c"? yes (matched "a.b.c")
-data from lookup saved for cache for +relay_domains: a.b.c
+data from lookup saved for cache for +relay_domains: key 'a.b.c' value 'a.b.c'
a.b.c in "+relay_domains"? yes (matched "+relay_domains")
check verify = recipient
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
local_part=x domain=x.test.ex
checking domains
x.test.ex in "*.test.ex"? yes (matched "*.test.ex")
-data from lookup saved for cache for +local_domains: .test.ex
+data from lookup saved for cache for +local_domains: key 'x.test.ex' value '.test.ex'
x.test.ex in "+local_domains"? yes (matched "+local_domains")
calling r2 router
r2 router called for x@x.test.ex
queued for ut4 transport: local_part = d3
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d3@myhost.test.ex
transport: ut4
queued for ut4 transport: local_part = d2
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d2@myhost.test.ex
transport: ut4
queued for ut4 transport: local_part = d1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d1@myhost.test.ex
transport: ut4
queued for ut3 transport: local_part = c1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^c\d
routed by ut3 router (unseen)
envelope to: c1@myhost.test.ex
transport: ut3
queued for ut2 transport: local_part = b1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^b\d
routed by ut2 router (unseen)
envelope to: b1@myhost.test.ex
transport: ut2
queued for ut1 transport: local_part = a1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^a\d
routed by u1 router (unseen)
envelope to: a1@myhost.test.ex
transport: ut1
queued for ut6 transport: local_part = f3
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^f\d
routed by ut6 router (unseen)
envelope to: f3@myhost.test.ex
transport: ut6
queued for ut6 transport: local_part = f2
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^f\d
routed by ut6 router (unseen)
envelope to: f2@myhost.test.ex
transport: ut6
queued for ut6 transport: local_part = f1
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^f\d
routed by ut6 router (unseen)
envelope to: f1@myhost.test.ex
transport: ut6
queued for ut5 transport: local_part = e1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^e\d
routed by ut5 router (unseen)
envelope to: e1@myhost.test.ex
transport: ut5
queued for ut4 transport: local_part = d3
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d3@myhost.test.ex
transport: ut4
queued for ut4 transport: local_part = d2
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d2@myhost.test.ex
transport: ut4
queued for ut4 transport: local_part = d1
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^d\d
routed by ut4 router (unseen)
envelope to: d1@myhost.test.ex
transport: ut4
queued for ut3 transport: local_part = c1
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^c\d
routed by ut3 router (unseen)
envelope to: c1@myhost.test.ex
transport: ut3
queued for ut2 transport: local_part = b1
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^b\d
routed by ut2 router (unseen)
envelope to: b1@myhost.test.ex
transport: ut2
queued for ut1 transport: local_part = a1
domain = myhost.test.ex
errors_to=
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^a\d
routed by u1 router (unseen)
envelope to: a1@myhost.test.ex
transport: ut1
queued for ut1 transport: local_part = h1
domain = myhost.test.ex
errors_to=NULL
- domain_data=NULL localpart_data=NULL
+ domain_data=NULL localpart_data=^h\d
routed by ut8 router (unseen)
envelope to: h1@myhost.test.ex
transport: ut1
in TESTSUITE/aux-fixed/0414.list2
lookup yielded: b.domain-data
b.domain in "lsearch;TESTSUITE/aux-fixed/0414.list2"? yes (matched "lsearch;TESTSUITE/aux-fixed/0414.list2")
-data from lookup saved for cache for +B: b.domain-data
+data from lookup saved for cache for +B: key 'b.domain' value 'b.domain-data'
b.domain in "+A : +B"? yes (matched "+B")
-data from lookup saved for cache for +C: b.domain-data
+data from lookup saved for cache for +C: key 'b.domain' value 'b.domain-data'
b.domain in "!+C"? no (matched "!+C")
r1 router skipped: domains mismatch
--------> r2 router <--------
in TESTSUITE/aux-fixed/0414.list1
lookup yielded: a.domain-data
a.domain in "lsearch;TESTSUITE/aux-fixed/0414.list1"? yes (matched "lsearch;TESTSUITE/aux-fixed/0414.list1")
-data from lookup saved for cache for +A: a.domain-data
+data from lookup saved for cache for +A: key 'a.domain' value 'a.domain-data'
a.domain in "+A : +B"? yes (matched "+A")
-data from lookup saved for cache for +C: a.domain-data
+data from lookup saved for cache for +C: key 'a.domain' value 'a.domain-data'
a.domain in "!+C"? no (matched "!+C")
r1 router skipped: domains mismatch
--------> r2 router <--------
local_part=k domain=mxt13.test.ex
checking domains
mxt13.test.ex in "!mxt13.test.ex : !other1.test.ex : *.test.ex"? no (matched "!mxt13.test.ex")
-data from lookup saved for cache for +local_domains: mxt13.test.ex
+data from lookup saved for cache for +local_domains: key 'mxt13.test.ex' value 'mxt13.test.ex'
mxt13.test.ex in "! +local_domains"? yes (end of list)
calling dnslookup router
dnslookup router called for k@mxt13.test.ex
in TESTSUITE/aux-fixed/0464.domains
lookup yielded: data for domain1
domain1 in "lsearch;TESTSUITE/aux-fixed/0464.domains"? yes (matched "lsearch;TESTSUITE/aux-fixed/0464.domains")
-data from lookup saved for cache for +special_domains: data for domain1
+data from lookup saved for cache for +special_domains: key 'domain1' value 'data for domain1'
domain1 in "+special_domains"? yes (matched "+special_domains")
check verify = recipient
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
host_find_bydns yield = HOST_FOUND_LOCAL (4); returned hosts:
eximtesthost.test.ex ip4.ip4.ip4.ip4 MX=5
mxt1.test.ex in "@mx_any"? yes (matched "@mx_any")
-data from lookup saved for cache for +anymx: @mx_any
+data from lookup saved for cache for +anymx: key 'mxt1.test.ex' value '@mx_any'
mxt1.test.ex in "+anymx"? yes (matched "+anymx")
checking "condition" "${if match_domain{$domain}{+anymx}{yes}}"...
DNS lookup of mxt1.test.ex (MX) using fakens