summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/smtpd/dns.c5
-rw-r--r--usr.sbin/smtpd/mta.c15
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/dns.c b/usr.sbin/smtpd/dns.c
index 300b7aa3eb1..749c0280902 100644
--- a/usr.sbin/smtpd/dns.c
+++ b/usr.sbin/smtpd/dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.17 2009/11/05 12:05:47 jsing Exp $ */
+/* $OpenBSD: dns.c,v 1.18 2009/11/05 12:11:53 jsing Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -367,9 +367,10 @@ again:
switch (h_errno) {
case TRY_AGAIN:
return (EAI_AGAIN);
+ case HOST_NOT_FOUND:
+ return (EAI_NONAME);
case NO_RECOVERY:
return (EAI_FAIL);
- case HOST_NOT_FOUND:
case NO_DATA:
*res = NULL;
return (0);
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index 4eb65020a53..1f73f677eb6 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.73 2009/11/05 12:05:47 jsing Exp $ */
+/* $OpenBSD: mta.c,v 1.74 2009/11/05 12:11:53 jsing Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -752,8 +752,17 @@ mta_pickup(struct mta_session *s, void *p)
case MTA_MX:
/* LKA responded to DNS lookup. */
error = *(int *)p;
- if (error) {
- mta_status(s, "100 MX lookup failed");
+ if (error == EAI_AGAIN) {
+ /* Temporary failure. */
+ mta_status(s, "100 MX lookup failed temporarily");
+ mta_enter_state(s, MTA_DONE, NULL);
+ } else if (error == EAI_NONAME) {
+ /* No such domain. */
+ mta_status(s, "600 Domain does not exist");
+ mta_enter_state(s, MTA_DONE, NULL);
+ } else if (error) {
+ /* Permanent failure. */
+ mta_status(s, "600 Unable to resolve DNS for domain");
mta_enter_state(s, MTA_DONE, NULL);
} else
mta_enter_state(s, MTA_DATA, NULL);