Skip to content

Commit a034c54

Browse files
committed
as per 6543
Signed-off-by: Andrew Thornton <[email protected]>
1 parent d44ef83 commit a034c54

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

services/auth/source/smtp/source_authenticate.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ func (source *Source) Authenticate(user *models.User, login, password string) (*
2828
}
2929

3030
var auth smtp.Auth
31-
if source.Auth == PlainAuthentication {
31+
switch source.Auth {
32+
case PlainAuthentication:
3233
auth = smtp.PlainAuth("", login, password, source.Host)
33-
} else if source.Auth == LoginAuthentication {
34+
case LoginAuthentication:
3435
auth = &loginAuthenticator{login, password}
35-
} else if source.Auth == CRAMMD5Authentication {
36+
case CRAMMD5Authentication:
3637
auth = smtp.CRAMMD5Auth(login, password)
37-
} else {
38+
default:
3839
return nil, errors.New("unsupported SMTP auth type")
3940
}
4041

0 commit comments

Comments
 (0)