summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2018-08-22 10:11:44 +0000
committerEric Faurot <eric@cvs.openbsd.org>2018-08-22 10:11:44 +0000
commitaf8c550b52963e151df1503f5a70e1e0d2b23d32 (patch)
treecd942d0c2a9cf35ef67db632fe6395fcdbfa99ce /usr.sbin
parent422f190e92657f8e66ee704830be5d94b0feef05 (diff)
Fix a crash when relaying with authentication but auth table is not set.
found by and ok stsp@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/mta.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index 5b398381123..c219b079c04 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.221 2018/07/25 16:00:48 eric Exp $ */
+/* $OpenBSD: mta.c,v 1.222 2018/08/22 10:11:43 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -645,6 +645,17 @@ mta_handle_envelope(struct envelope *evp, const char *smarthost)
return;
}
+ if (relayh.flags & RELAY_AUTH && dispatcher->u.remote.auth == NULL) {
+ log_warnx("warn: No auth table on action \"%s\" for relay %s",
+ evp->dispatcher, smarthost);
+ m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1);
+ m_add_evpid(p_queue, evp->id);
+ m_add_string(p_queue, "No auth table for relaying");
+ m_add_int(p_queue, ESC_OTHER_STATUS);
+ m_close(p_queue);
+ return;
+ }
+
relay = mta_relay(evp, &relayh);
/* ignore if we don't know the limits yet */
if (relay->limits &&