Remove redundant connection check in tls function

The `tls` function in `client.go` no longer checks for an active connection before executing. This simplifies the code since the connection check is either redundant or already handled elsewhere in the flow.
This commit is contained in:
Winni Neessen 2024-10-24 09:19:08 +02:00
parent 28dc629674
commit e442419c18
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -1360,9 +1360,6 @@ func (c *Client) setDefaultHelo() error {
// - An error if there is no active connection, if STARTTLS is required but not supported,
// or if there are issues during the TLS handshake; otherwise, returns nil.
func (c *Client) tls() error {
if !c.smtpClient.HasConnection() {
return ErrNoActiveConnection
}
if !c.useSSL && c.tlspolicy != NoTLS {
hasStartTLS := false
extension, _ := c.smtpClient.Extension("STARTTLS")