Index | Thread | Search

From:
"Omar Polo" <op@omarpolo.com>
Subject:
smtpd: fallback for NOTIMP in dns_dispatch_mx
To:
tech@openbsd.org
Date:
Wed, 11 Nov 2026 00:42:45 +0100

Download raw body.

Thread
  • Omar Polo:

    smtpd: fallback for NOTIMP in dns_dispatch_mx

spotted while looking for something else.

dns.c rev 1.88 reads:

  treat NOTIMP as NO_DATA in response to MX query: fallback to hostname lookup
  instead of bouncing the mail.

but i think that the check wrong: it should test ar_rcode rather than
ar_h_errno, given that if the server replies NOTIMP (not implemented) I
guess ar_h_errno is at NO_RECOVERY (see res_send_async_run in
res_send_async.c).

so, this should make again NOTIMP failure resulting to the normal
fallback to A/AAA.

okay?

diff /usr/src
path + /usr/src
commit - 3dbbc6f9ce77759ee37eeaaf98eb4c7326b83e8f
blob - 48268d2ad551c6e72c4ba34c2360b559d87fcf53
file + usr.sbin/smtpd/dns.c
--- usr.sbin/smtpd/dns.c	
+++ usr.sbin/smtpd/dns.c	
@@ -235,7 +235,7 @@ dns_dispatch_mx(struct asr_result *ar, void *arg)
 	int			 nullmx = 0;
 
 	if (ar->ar_h_errno && ar->ar_h_errno != NO_DATA &&
-	    ar->ar_h_errno != NOTIMP) {
+	    ar->ar_rcode != NOTIMP) {
 		m_create(s->p,  IMSG_MTA_DNS_HOST_END, 0, 0, -1);
 		m_add_id(s->p, s->reqid);
 		if (ar->ar_rcode == NXDOMAIN)