From e442419c18748530c5f9e1371239cc3271f02a03 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Thu, 24 Oct 2024 09:19:08 +0200 Subject: [PATCH] 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. --- client.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/client.go b/client.go index f65766d..af56afc 100644 --- a/client.go +++ b/client.go @@ -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")