If the data for a PTR record is not a syntactically valid IP address, it is not
altered and nothing is added.
-.cindex "MX record" "in &(dnsdb)& lookup"
-.cindex "SRV record" "in &(dnsdb)& lookup"
-For an MX lookup, both the preference value and the host name are returned for
-each record, separated by a space. For an SRV lookup, the priority, weight,
-port, and host name are returned for each record, separated by spaces.
-
For any record type, if multiple records are found (or, for A6 lookups, if a
single record leads to multiple addresses), the data is returned as a
concatenation, with newline as the default separator. The order, of course,
It is permitted to specify a space as the separator character. Further
white space is ignored.
+.cindex "MX record" "in &(dnsdb)& lookup"
+.cindex "SRV record" "in &(dnsdb)& lookup"
+For an MX lookup, both the preference value and the host name are returned for
+each record, separated by a space. For an SRV lookup, the priority, weight,
+port, and host name are returned for each record, separated by spaces.
+.new
+An alternate field separator can be specified using a comma after the main
+separator character, followed immediately by the field separator.
+.wen
+
.cindex "TXT record" "in &(dnsdb)& lookup"
.cindex "SPF record" "in &(dnsdb)& lookup"
For TXT records with multiple items of data, only the first item is returned,
JH/02 Add EXPERIMENTAL_DANE, allowing for using the DNS as trust-anchor for
server certificates when making smtp deliveries.
+JH/03 Support secondary-separator specifier for MX, SRV, TLSA lookups.
+
Exim version 4.84
-----------------
/* SPF strings should be concatenated without a separator, thus make
it the default if not defined (see RFC 4408 section 3.1.3).
Multiple SPF records are forbidden (section 3.1.2) but are currently
-not handled specially, thus they are concatenated with \n by default. */
+not handled specially, thus they are concatenated with \n by default.
+MX priority and value are space-separated by default.
+SRV and TLSA record parts are space-separated by default. */
-if (type == T_SPF && outsep2 == NULL)
- outsep2 = US"";
+if (!outsep2) switch(type)
+ {
+ case T_SPF: outsep2 = US""; break;
+ case T_SRV: case T_MX: case T_TLSA: outsep2 = US" "; break;
+ }
/* Now scan the list and do a lookup for each item */
matching_type = *p++;
/* What's left after removing the first 3 bytes above */
payload_length = rr->size - 3;
- sp += sprintf(CS s, "%d %d %d ", usage, selector, matching_type);
+ sp += sprintf(CS s, "%d%c%d%c%d%c", usage, *outsep2,
+ selector, *outsep2, matching_type, *outsep2);
/* Now append the cert/identifier, one hex char at a time */
for (i=0;
i < payload_length && sp-s < (MAX_TLSA_EXPANDED_SIZE - 4);
else if (type == T_MX)
{
GETSHORT(priority, p);
- sprintf(CS s, "%d ", priority);
+ sprintf(CS s, "%d%c", priority, *outsep2);
yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
}
else if (type == T_SRV)
GETSHORT(priority, p);
GETSHORT(weight, p);
GETSHORT(port, p);
- sprintf(CS s, "%d %d %d ", priority, weight, port);
+ sprintf(CS s, "%d%c%d%c%d%c", priority, *outsep2,
+ weight, *outsep2, port, *outsep2);
yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
}
else if (type == T_CSA)
ten-1:defer:ten2 ${lookup dnsdb{a=ten-1.test.ex:test.again.dns:ten-2.test.ex}}
ten-1|ten2 ${lookup dnsdb{a=<|ten-1.test.ex|ten-2.test.ex}}
mxt1;mxt2 | output ${lookup dnsdb{>|mx=<;mxt1.test.ex;mxt2.test.ex}}
+mxt1;mxt2 | output+field ${lookup dnsdb{>|,:mx=<;mxt1.test.ex;mxt2.test.ex}}
mxt1;mxt2 | output ${lookup dnsdb{>|mxh=<;mxt1.test.ex;mxt2.test.ex}}
13/14 rbl ${lookup dnsdb{> 13.12.11.V4NET.rbl.test.ex:13.12.11.V4NET.rbl.test.ex}}
double ptr ${lookup dnsdb{ptr=V4NET.0.0.1:V4NET.0.0.2}}
> ten-1|ten2 V4NET.0.0.1
V4NET.0.0.2
> mxt1;mxt2 | output 5 eximtesthost.test.ex|5 not-exist.test.ex
+> mxt1;mxt2 | output+field 5:eximtesthost.test.ex|5:not-exist.test.ex
> mxt1;mxt2 | output eximtesthost.test.ex|not-exist.test.ex
> 13/14 rbl This is a test blacklisting message This is a test blacklisting message
> double ptr ten-1.test.ex