Verify that user is properly authenticated before sending mail if AUTH is required
This commit is contained in:
parent
9c93a62f1a
commit
d345a27f9f
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue