diff --git a/README.md b/README.md index 69924989..51f4bafa 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ type Session struct{} func (s *Session) AuthPlain(username, password string) error { if username != "username" || password != "password" { - return errors.New("Invalid username or password") + return smtp.ErrAuthFailed } return nil } diff --git a/backend.go b/backend.go index 59cea3aa..d61f3f66 100644 --- a/backend.go +++ b/backend.go @@ -5,6 +5,11 @@ import ( ) var ( + ErrAuthFailed = &SMTPError{ + Code: 535, + EnhancedCode: EnhancedCode{5, 7, 8}, + Message: "Authentication failed", + } ErrAuthRequired = &SMTPError{ Code: 502, EnhancedCode: EnhancedCode{5, 7, 0},