Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
as per 6543
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Aug 11, 2021
commit a034c5461e3af657b981700ab0c126db4107a8c1
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