feat(GODT-2714): Apply PR comments.

This commit is contained in:
Romain LE JEUNE
2023-06-29 09:54:42 +02:00
parent 720f662afe
commit c43739a7ef
3 changed files with 10 additions and 5 deletions

View File

@ -72,7 +72,12 @@ func (s *smtpSession) AuthPlain(username, password string) error {
}).Error("Incorrect login credentials.")
err := fmt.Errorf("invalid username or password")
for _, user := range s.users {
user.ReportConfigStatusFailure(err.Error())
for _, mail := range user.Emails() {
if mail == username {
user.ReportConfigStatusFailure(err.Error())
return err
}
}
}
return err
}, s.usersLock)