pop3

package module
v0.0.0-...-8209532 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 9 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 {
	// contains filtered or unexported fields
}

The POP3 client.

func Dial

func Dial(addr string) (*Client, error)

Dial creates an unsecured connection to the POP3 server at the given address and returns the corresponding Client.

func DialTLS

func DialTLS(addr string) (*Client, error)

DialTLS creates a TLS-secured connection to the POP3 server at the given address and returns the corresponding Client.

func NewClient

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

NewClient returns a new Client object using an existing connection.

func (*Client) Auth

func (c *Client) Auth(username, password string) error

Auth sends the given username and password to the server, calling the User and Pass methods as appropriate.

func (*Client) Caps

func (c *Client) Caps() (caps []string, err error)

func (*Client) Cmd

func (c *Client) Cmd(format string, args ...interface{}) (string, error)

Convenience function to synchronously run an arbitrary command and wait for output. The terminating CRLF must be included in the format string.

Output sent after the first line must be retrieved via readLines.

func (*Client) Dele

func (c *Client) Dele(msg int) (err error)

Dele marks the given message as deleted.

func (*Client) List

func (c *Client) List(msg int) (size int, err error)

List returns the size of the given message, if it exists. If the message does not exist, or another error is encountered, the returned size will be 0.

func (*Client) ListAll

func (c *Client) ListAll() (msgs []int, sizes []int, err error)

ListAll returns a list of all messages and their sizes.

func (*Client) Noop

func (c *Client) Noop() (err error)

Noop does nothing, but will prolong the end of the connection if the server has a timeout set.

func (*Client) Quit

func (c *Client) Quit() error

Quit sends the QUIT message to the POP3 server and closes the connection.

func (*Client) ReadLines

func (c *Client) ReadLines() (lines []string, err error)

func (*Client) Retr

func (c *Client) Retr(msg int) (text string, err error)

Retr downloads and returns the given message. The lines are separated by LF, whatever the server sent.

func (*Client) Rset

func (c *Client) Rset() (err error)

Rset unmarks any messages marked for deletion previously in this session.

func (*Client) Stat

func (c *Client) Stat() (count, size int, err error)

Stat retrieves a drop listing for the current maildrop, consisting of the number of messages and the total size (in octets) of the maildrop. Information provided besides the number of messages and the size of the maildrop is ignored. In the event of an error, all returned numeric values will be 0.

Jump to

Keyboard shortcuts

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