summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2020-02-01 15:33:47 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2020-02-01 15:33:47 +0000
commita34b47c14d22f07a2207de3d3fa37357efe71c56 (patch)
tree1da0ce7b277b981422455e67a87d958270891c34 /usr.sbin
parent96cbf355bbb644834585b1645fde972d4764004b (diff)
be much stricter about ORCPT, it isn't in the code path of local delivery
and doesn't have an associated context variable, but let's be paranoid. ok millert@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/smtp_session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 1af4c6f9776..3ff9bb00093 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.422 2020/01/28 21:35:00 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.423 2020/02/01 15:33:46 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2573,7 +2573,9 @@ smtp_tx_rcpt_to(struct smtp_tx *tx, const char *line)
}
} else if (ADVERTISE_EXT_DSN(tx->session) && strncasecmp(opt, "ORCPT=", 6) == 0) {
opt += 6;
- if (!text_to_mailaddr(&tx->evp.dsn_orcpt, opt)) {
+ if (!text_to_mailaddr(&tx->evp.dsn_orcpt, opt) ||
+ !valid_localpart(tx->evp.dsn_orcpt.user) ||
+ !valid_domainpart(tx->evp.dsn_orcpt.domain)) {
smtp_reply(tx->session,
"553 ORCPT address syntax error");
return;