From 611dc6d7e0fa40b56c1ed813e3d10ff60f2e9115 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Mon, 3 Feb 2020 15:53:53 +0000 Subject: 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 --- usr.sbin/smtpd/mta_session.c | 4 ++-- usr.sbin/smtpd/smtp_session.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.sbin/smtpd') 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 @@ -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 @@ -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)) { -- cgit v1.2.3