diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-07-20 10:22:55 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-07-20 10:22:55 +0000 |
commit | 8e9f07389c9968fc6313dfa520da7ec09d892b76 (patch) | |
tree | b96d1787bf2ee1a41d9c28812ceba6b8e15aa5ab /usr.sbin/smtpd/mta.c | |
parent | 78cc6364dc5e6e09fe86328fe858d182fa0d8dab (diff) |
Fix reporting of permanent/temporary failures for MX lookups.
Simplify code a bit while there.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/mta.c')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 935131b5e8d..7959cc09407 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.109 2011/07/19 13:15:54 eric Exp $ */ +/* $OpenBSD: mta.c,v 1.110 2011/07/20 10:22:54 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -552,15 +552,15 @@ mta_pickup(struct mta_session *s, void *p) case MTA_MX: /* LKA responded to DNS lookup. */ - error = *(int *)p; - if (error == EAI_AGAIN) { - mta_status(s, "100 MX lookup failed temporarily"); - mta_enter_state(s, MTA_DONE, NULL); - } else if (error == EAI_NONAME) { - mta_status(s, "600 Domain does not exist"); - mta_enter_state(s, MTA_DONE, NULL); - } else if (error) { - mta_status(s, "600 Unable to resolve DNS for domain"); + if ((error = *(int *)p)) { + if (error == DNS_RETRY) + mta_status(s, "100 MX lookup failed temporarily"); + else if (error == DNS_EINVAL) + mta_status(s, "600 Invalid domain name"); + else if (error == DNS_ENONAME) + mta_status(s, "600 Domain does not exist"); + else if (error == DNS_ENOTFOUND) + mta_status(s, "600 No MX address found for domain"); mta_enter_state(s, MTA_DONE, NULL); } else mta_enter_state(s, MTA_DATA, NULL); |