Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl committed Mar 4, 2024
1 parent 4e583cd commit c36c26f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions courier/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewSMTPClient(deps Dependencies, cfg *config.SMTPConfig) (*SMTPClient, erro
}

tlsConfig := &tls.Config{
InsecureSkipVerify: sslSkipVerify,
InsecureSkipVerify: sslSkipVerify, //#nosec G402 -- This is ok (and required!) because it is configurable and disabled by default.
Certificates: tlsCertificates,
ServerName: serverName,
MinVersion: tls.VersionTLS12,
Expand All @@ -82,13 +82,11 @@ func NewSMTPClient(deps Dependencies, cfg *config.SMTPConfig) (*SMTPClient, erro
// Enforcing StartTLS by default for security best practices (config review, etc.)
skipStartTLS, _ := strconv.ParseBool(uri.Query().Get("disable_starttls"))
if !skipStartTLS {
//#nosec G402 -- This is ok (and required!) because it is configurable and disabled by default.
dialer.TLSConfig = tlsConfig
// Enforcing StartTLS
dialer.StartTLSPolicy = gomail.MandatoryStartTLS
}
case "smtps":
//#nosec G402 -- This is ok (and required!) because it is configurable and disabled by default.
dialer.TLSConfig = tlsConfig
dialer.SSL = true
}
Expand Down

0 comments on commit c36c26f

Please sign in to comment.