Verify that user is properly authenticated before sending mail if AUTH is required

This commit is contained in:
Bernhard Froehlich 2020-05-11 13:12:24 +00:00
parent 9c93a62f1a
commit d345a27f9f
No known key found for this signature in database
GPG key ID: 4DD88C3F9F3B8333

View file

@ -202,6 +202,11 @@ func (session *session) handleMAIL(cmd command) {
return
}
if session.server.Authenticator != nil && session.peer.Username == "" {
session.reply(530, "Authentication Required.")
return
}
if !session.tls && session.server.ForceTLS {
session.reply(502, "Please turn on TLS by issuing a STARTTLS command.")
return