summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorJoerg Jung <jung@cvs.openbsd.org>2020-11-20 20:37:57 +0000
committerJoerg Jung <jung@cvs.openbsd.org>2020-11-20 20:37:57 +0000
commit15d8d71345ec8a351cd0888376ff3e365fed0ec4 (patch)
tree425a882e72b2093a3cc2062b556e2f6196257c30 /usr.sbin/smtpd
parentb92bbd9b1b9b0c50064373848bfebd17d7dfdf14 (diff)
partially revert revision 1.423 which went a bit too far
slightly relax the ORCPT check by not enforcing that a domain is required, allowing e.g.: ORCPT=rfc822;root originally reported via github issue #1084 by Leo Gaspard with input from gilles ok kn
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/smtp_session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 5ea9f89ed9a..60123ad9a80 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.426 2020/04/24 11:34:07 eric Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.427 2020/11/20 20:37:56 jung Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2583,7 +2583,8 @@ smtp_tx_rcpt_to(struct smtp_tx *tx, const char *line)
if (!text_to_mailaddr(&tx->evp.dsn_orcpt, opt) ||
!valid_localpart(tx->evp.dsn_orcpt.user) ||
- !valid_domainpart(tx->evp.dsn_orcpt.domain)) {
+ (strlen(tx->evp.dsn_orcpt.domain) != 0 &&
+ !valid_domainpart(tx->evp.dsn_orcpt.domain))) {
smtp_reply(tx->session,
"553 ORCPT address syntax error");
return;