Skip to content

Commit

Permalink
client: drop Client.tls
Browse files Browse the repository at this point in the history
This is unused.
  • Loading branch information
emersion committed Dec 27, 2023
1 parent 4e0e400 commit 6ecbad7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 2 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ import (
type Client struct {
// keep a reference to the connection so it can be used to create a TLS
// connection later
conn net.Conn
text *textproto.Conn
// whether the Client is using TLS
tls bool
conn net.Conn
text *textproto.Conn
serverName string
lmtp bool
// map of supported extensions
Expand Down Expand Up @@ -138,9 +136,6 @@ func (c *Client) setConn(conn net.Conn) {
Closer: conn,
}
c.text = textproto.NewConn(rwc)

_, isTLS := conn.(*tls.Conn)
c.tls = isTLS
}

// Close closes the connection.
Expand Down
5 changes: 0 additions & 5 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func TestClientAuthTrimSpace(t *testing.T) {
&wrote,
}
c := NewClient(fake)
c.tls = true
c.didHello = true
c.Auth(toServerEmptyAuth{})
c.Close()
Expand Down Expand Up @@ -110,8 +109,6 @@ func TestBasic(t *testing.T) {
t.Fatalf("Second VRFY: expected verification, got %s", err)
}

// fake TLS so authentication won't complain
c.tls = true
c.serverName = "smtp.google.com"
if err := c.Auth(sasl.NewPlainClient("", "user", "pass")); err != nil {
t.Fatalf("AUTH failed: %s", err)
Expand Down Expand Up @@ -428,7 +425,6 @@ func TestHello(t *testing.T) {
case 2:
err = c.Verify("[email protected]")
case 3:
c.tls = true
c.serverName = "smtp.google.com"
err = c.Auth(sasl.NewPlainClient("", "user", "pass"))
case 4:
Expand Down Expand Up @@ -538,7 +534,6 @@ func TestAuthFailed(t *testing.T) {
c := NewClient(fake)
defer c.Close()

c.tls = true
c.serverName = "smtp.google.com"
err := c.Auth(sasl.NewPlainClient("", "user", "pass"))

Expand Down

0 comments on commit 6ecbad7

Please sign in to comment.