diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2020-02-01 15:33:47 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2020-02-01 15:33:47 +0000 |
commit | a34b47c14d22f07a2207de3d3fa37357efe71c56 (patch) | |
tree | 1da0ce7b277b981422455e67a87d958270891c34 /usr.sbin/smtpd/smtp_session.c | |
parent | 96cbf355bbb644834585b1645fde972d4764004b (diff) |
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/smtp_session.c')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 6 |
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; |