Skip to content

Commit

Permalink
Permit backend Auth method to return own error message
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
tuck1s authored and emersion committed May 12, 2019
1 parent 930d6df commit 469c269
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ func (c *Conn) handleAuth(arg string) {
for {
challenge, done, err := sasl.Next(response)
if err != nil {
if smtpErr, ok := err.(*SMTPError); ok {
c.WriteResponse(smtpErr.Code, smtpErr.EnhancedCode, smtpErr.Message)
return
}
c.WriteResponse(454, EnhancedCode{4, 7, 0}, err.Error())
return
}
Expand Down

0 comments on commit 469c269

Please sign in to comment.