imaputil

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Text is the textproto.Conn used by the Client. It is exported to allow for
	// clients to add extensions.
	Text *textproto.Conn
	// contains filtered or unexported fields
}

A Client represents a client connection to an IMAP server.

func Dial

func Dial(network string, addr string, timeout time.Duration) (*Client, error)

Dial returns a new Client connected to an IMAP server at addr. The addr must include a port, as in "mail.example.com:443".

func NewClient

func NewClient(conn net.Conn) (*Client, error)

NewClient returns a new Client using an existing connection.

func (*Client) Capability

func (c *Client) Capability() error

Capability sends the CAPABILITY command to the server.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection.

func (*Client) Logout

func (c *Client) Logout() error

Logout sends the LOGOUT command and closes the connection to the server.

func (*Client) StartTLS

func (c *Client) StartTLS(config *tls.Config) error

StartTLS sends the STARTTLS command and encrypts all further communication. Only servers that advertise the STARTTLS extension support this function.

func (*Client) TLSConnectionState

func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)

TLSConnectionState returns the client's TLS connection state. The return values are their zero values if StartTLS did not succeed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL