diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-20 18:48:24 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-20 18:48:24 +0000 |
commit | 9e4b369d41f3d5f31e4ece4b7edeb8cac1492db7 (patch) | |
tree | b5ce4c3c9a8d05d3a150f2da8eff5f29ba02b902 /usr.sbin | |
parent | faed401133ebbec0d2e8156a4ad2579dd4d71706 (diff) |
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@
Diffstat (limited to 'usr.sbin')
-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; |