consider an MX of "localhost" as it were a "Null MX"
authorop <op@openbsd.org>
Thu, 16 Nov 2023 10:23:21 +0000 (10:23 +0000)
committerop <op@openbsd.org>
Thu, 16 Nov 2023 10:23:21 +0000 (10:23 +0000)
diff from Philipp (philipp+openbsd [at] bureaucracy [dot] de), thanks!

ok sthen@

usr.sbin/smtpd/dns.c

index dc7987a..b1b49ea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dns.c,v 1.91 2023/11/08 08:46:34 op Exp $     */
+/*     $OpenBSD: dns.c,v 1.92 2023/11/16 10:23:21 op Exp $     */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -263,7 +263,8 @@ dns_dispatch_mx(struct asr_result *ar, void *arg)
                print_dname(rr.rr.mx.exchange, buf, sizeof(buf));
                buf[strlen(buf) - 1] = '\0';
 
-               if (rr.rr.mx.preference == 0 && !strcmp(buf, "")) {
+               if ((rr.rr.mx.preference == 0 && !strcmp(buf, "")) ||
+                   !strcmp(buf, "localhost")) {
                        nullmx = 1;
                        continue;
                }