fix error messages

This commit is contained in:
Craig 2016-02-12 01:35:10 +00:00
parent 66f94a07ae
commit 12d460e481

View file

@ -167,17 +167,17 @@ func (session *session) handleEHLO(cmd command) {
func (session *session) handleMAIL(cmd command) { func (session *session) handleMAIL(cmd command) {
if len(cmd.params) != 2 || strings.ToUpper(cmd.params[0]) != "FROM" { if len(cmd.params) != 2 || strings.ToUpper(cmd.params[0]) != "FROM" {
session.reply(502, "Syntax error") session.reply(502, "Invalid syntax.")
return return
} }
if session.peer.HeloName == "" { if session.peer.HeloName == "" {
session.reply(502, "Please introduce yourself first") session.reply(502, "Please introduce yourself first.")
return return
} }
if !session.tls && session.server.ForceTLS { if !session.tls && session.server.ForceTLS {
session.reply(502, "Please turn on TLS by issuing a STARTTLS command") session.reply(502, "Please turn on TLS by issuing a STARTTLS command.")
return return
} }
@ -213,7 +213,7 @@ func (session *session) handleMAIL(cmd command) {
func (session *session) handleRCPT(cmd command) { func (session *session) handleRCPT(cmd command) {
if len(cmd.params) != 2 || strings.ToUpper(cmd.params[0]) != "TO" { if len(cmd.params) != 2 || strings.ToUpper(cmd.params[0]) != "TO" {
session.reply(502, "Syntax error") session.reply(502, "Invalid syntax.")
return return
} }