diff --git a/client.go b/client.go index 4149240..fc7d740 100644 --- a/client.go +++ b/client.go @@ -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 @@ -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. diff --git a/client_test.go b/client_test.go index b6693c5..06b8980 100644 --- a/client_test.go +++ b/client_test.go @@ -34,7 +34,6 @@ func TestClientAuthTrimSpace(t *testing.T) { &wrote, } c := NewClient(fake) - c.tls = true c.didHello = true c.Auth(toServerEmptyAuth{}) c.Close() @@ -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) @@ -428,7 +425,6 @@ func TestHello(t *testing.T) { case 2: err = c.Verify("test@example.com") case 3: - c.tls = true c.serverName = "smtp.google.com" err = c.Auth(sasl.NewPlainClient("", "user", "pass")) case 4: @@ -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"))