diff options
author | gilles <gilles@openbsd.org> | 2020-02-03 15:53:52 +0000 |
---|---|---|
committer | gilles <gilles@openbsd.org> | 2020-02-03 15:53:52 +0000 |
commit | 2d8fd64b38a16b3d14b7c5d4037b7a32513a2f88 (patch) | |
tree | 57801b249c00a61240dab8766fe960c897253a46 /usr.sbin/smtpd | |
parent | now that mail.local(8) relies on lockspool(1) for mailbox locking, have the (diff) | |
download | wireguard-openbsd-2d8fd64b38a16b3d14b7c5d4037b7a32513a2f88.tar.xz wireguard-openbsd-2d8fd64b38a16b3d14b7c5d4037b7a32513a2f88.zip |
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.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)) { |