summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2020-02-01 15:33:46 +0000
committergilles <gilles@openbsd.org>2020-02-01 15:33:46 +0000
commit18b9798e50bec0b732ce00b813977c4e7df109e4 (patch)
treebc3a9982fe56c003621e931409004dc14feed26b /usr.sbin/smtpd
parentGrab the kernel lock in pgsigio() as it's strictly needed while (diff)
downloadwireguard-openbsd-18b9798e50bec0b732ce00b813977c4e7df109e4.tar.xz
wireguard-openbsd-18b9798e50bec0b732ce00b813977c4e7df109e4.zip
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/smtpd')
-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;