+ else /* T_CNAME, T_MX, T_MXH, T_NS, T_SRV, T_PTR */
+ {
+ int num;
+ uschar s[264];
+ uschar *p = (uschar *)(rr->data);
+
+ if (type == T_MXH)
+ {
+ /* mxh ignores the priority number and includes only the hostnames */
+ GETSHORT(num, p); /* pointer is advanced */
+ }
+ else if (type == T_MX)
+ {
+ GETSHORT(num, p); /* pointer is advanced */
+ sprintf(CS s, "%d ", num);
+ yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
+ }
+ else if (type == T_SRV)
+ {
+ int weight, port;
+ GETSHORT(num, p); /* pointer is advanced */
+ GETSHORT(weight, p);
+ GETSHORT(port, p);
+ sprintf(CS s, "%d %d %d ", num, weight, port);
+ yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
+ }
+
+ rc = dn_expand(dnsa.answer, dnsa.answer + dnsa.answerlen, p,
+ (DN_EXPAND_ARG4_TYPE)(s), sizeof(s));
+
+ /* If an overlong response was received, the data will have been
+ truncated and dn_expand may fail. */
+
+ if (rc < 0)
+ {
+ log_write(0, LOG_MAIN, "host name alias list truncated: type=%s "
+ "domain=%s", dns_text_type(type), domain);
+ break;
+ }
+ else yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
+ }
+ } /* Loop for list of returned records */
+ } /* Loop for list of domains */
+
+/* Reclaim unused memory */