summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2020-02-03 15:53:53 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2020-02-03 15:53:53 +0000
commit611dc6d7e0fa40b56c1ed813e3d10ff60f2e9115 (patch)
tree08578fe7ee13ccca53db446cf5b822b6084b97e2 /usr.sbin/smtpd
parent7007843527cac817071f7f3cb4ff8417ea857f6f (diff)
ORCPT addresses are prefixed with an address type, the stricter check cause
the prefix to be rejected as it contains a character not allowed in address reported by Scott Vanderbilt
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/mta_session.c4
-rw-r--r--usr.sbin/smtpd/smtp_session.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c
index 9459d69275f..b57a93d62a2 100644
--- a/usr.sbin/smtpd/mta_session.c
+++ b/usr.sbin/smtpd/mta_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta_session.c,v 1.130 2020/01/20 10:18:20 gilles Exp $ */
+/* $OpenBSD: mta_session.c,v 1.131 2020/02/03 15:53:52 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -824,7 +824,7 @@ again:
e->dest,
e->dsn_notify ? " NOTIFY=" : "",
e->dsn_notify ? dsn_strnotify(e->dsn_notify) : "",
- e->dsn_orcpt ? " ORCPT=" : "",
+ e->dsn_orcpt ? " ORCPT=rfc822;" : "",
e->dsn_orcpt ? e->dsn_orcpt : "");
} else
mta_send(s, "RCPT TO:<%s>", e->dest);
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 3ff9bb00093..87ae18a6667 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.423 2020/02/01 15:33:46 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.424 2020/02/03 15:53:52 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2573,6 +2573,10 @@ 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 (strncasecmp(opt, "rfc822;", 7) == 0)
+ opt += 7;
+
if (!text_to_mailaddr(&tx->evp.dsn_orcpt, opt) ||
!valid_localpart(tx->evp.dsn_orcpt.user) ||
!valid_domainpart(tx->evp.dsn_orcpt.domain)) {