diff options
author | 2009-04-20 18:48:23 +0000 | |
---|---|---|
committer | 2009-04-20 18:48:23 +0000 | |
commit | c435c95fa28b2750857a830220c3c3341694eb68 (patch) | |
tree | e2ce2d77b2e8329a629b5148347f377a6afceb5a | |
parent | sync (diff) | |
download | wireguard-openbsd-c435c95fa28b2750857a830220c3c3341694eb68.tar.xz wireguard-openbsd-c435c95fa28b2750857a830220c3c3341694eb68.zip |
Allow MAIL FROM only in the S_HELO state, which results in behaviour
dictated by rfc in "4.1.4 Order of commands".
pointed out and initial diff by pea@, ok gilles@
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 27fb19ea105..c0b7076a9a9 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.69 2009/04/20 17:40:38 jacekm Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.70 2009/04/20 18:48:23 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -384,6 +384,11 @@ session_rfc5321_mail_handler(struct session *s, char *args) return 1; } + if (s->s_state != S_HELO) { + session_respond(s, "503 Sender already specified"); + return 1; + } + if (strlcpy(buffer, args, sizeof(buffer)) >= sizeof(buffer)) { session_respond(s, "553 Sender address syntax error"); return 1; |