Skip to content

Commit

Permalink
Update smtp.go
Browse files Browse the repository at this point in the history
Signed-off-by: kannan-nic <[email protected]>
  • Loading branch information
kannan-nic authored May 2, 2024
1 parent 3ef2992 commit 6251b46
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions connector/smtp/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ func (sc *smtpConnector) Login(ctx context.Context, _ connector.Scopes, username
// Dial

var conn net.Conn

if p == "" || p == "25" {
if strings.Contains(p, "tls") {

sc.cfg.Host = sc.cfg.Host[0 : len(sc.cfg.Host)-3]
p = p[0 : len(p)-3]
tlsconfig := &tls.Config {
InsecureSkipVerify: true,
ServerName: h,
Expand All @@ -49,6 +51,12 @@ func (sc *smtpConnector) Login(ctx context.Context, _ connector.Scopes, username
if err != nil {
return
}
}
else if p == "" || p == "465" {

Check failure on line 55 in connector/smtp/smtp.go

View workflow job for this annotation

GitHub Actions / Test

syntax error: unexpected else, expected }

Check failure on line 55 in connector/smtp/smtp.go

View workflow job for this annotation

GitHub Actions / Lint

syntax error: unexpected else, expected } (typecheck)

Check failure on line 55 in connector/smtp/smtp.go

View workflow job for this annotation

GitHub Actions / Lint

expected statement, found 'else' (typecheck)

Check failure on line 55 in connector/smtp/smtp.go

View workflow job for this annotation

GitHub Actions / Lint

syntax error: unexpected else, expected }) (typecheck)
conn, err = tls.Dial("tcp", sc.cfg.Host, nil)
if err != nil {
return
}
} else {
conn, err = net.Dial("tcp", sc.cfg.Host)
if err != nil {
Expand Down

0 comments on commit 6251b46

Please sign in to comment.