diff options
-rw-r--r-- | usr.sbin/smtpd/mta_session.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 6 |
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)) { |