Skip to content

Commit

Permalink
as per 6543
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Aug 11, 2021
1 parent d44ef83 commit a034c54
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions services/auth/source/smtp/source_authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ func (source *Source) Authenticate(user *models.User, login, password string) (*
}

var auth smtp.Auth
if source.Auth == PlainAuthentication {
switch source.Auth {
case PlainAuthentication:
auth = smtp.PlainAuth("", login, password, source.Host)
} else if source.Auth == LoginAuthentication {
case LoginAuthentication:
auth = &loginAuthenticator{login, password}
} else if source.Auth == CRAMMD5Authentication {
case CRAMMD5Authentication:
auth = smtp.CRAMMD5Auth(login, password)
} else {
default:
return nil, errors.New("unsupported SMTP auth type")
}

Expand Down

0 comments on commit a034c54

Please sign in to comment.