pop3: bitbucket.org/gotamer/pop3 Index | Files

package pop3

import "bitbucket.org/gotamer/pop3"

Package pop3 provides an implementation of the Post Office Protocol - Version 3.

Index

Package Files

constants.go pop3.go types.go util.go

Constants

const (
    USER = "USER"
    PASS = "PASS"
    QUIT = "QUIT"
    STAT = "STAT"
    LIST = "LIST"
    RETR = "RETR"
    DELE = "DELE"
    NOOP = "NOOP"
    RSET = "RSET"
)

Non optional POP3 commands as extracted from rfc1939 section 5 and 6.

const (
    ATOP = "ATOP"
    TOP  = "TOP"
    UIDL = "UIDL"
)

Optional POP3 commands as extracted from rfc1939 section 7.

const (
    OK  = "+OK"
    ERR = "-ERR"
)

POP3 replies as extracted from rfc1939 section 9.

func IsErr Uses

func IsErr(s string) bool

IsErr checks to see if the reply from the server contains +Err.

func IsOK Uses

func IsOK(s string) bool

IsOK checks to see if the reply from the server contains +OK.

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client holds the net conn and read/write buffer objects.

func Dial Uses

func Dial(address string) (c *Client, err error)

Dial connects to the address on the named network.

func DialTLS Uses

func DialTLS(address string, selfsigned bool) (c *Client, err error)

DialTLS connects to the address on the named network using tls.

func NewClient Uses

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

NewClient returns a new client object using an existing connection.

func (*Client) Auth Uses

func (c *Client) Auth(u, p string) (err error)

Auth sends the username and password to the server using the User and Pass methods. Noop is also called incase the server does not respond with invalid auth.

func (*Client) Cmd Uses

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

Cmd sends a command to the server and returns a single line from the buffer.

func (*Client) Dele Uses

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

Dele will delete the given message from the maildrop. Changes will only take affect after the Quit command is issued.

func (*Client) List Uses

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

List returns the MessageList object which contains the message non unique id and its size.

func (*Client) ListAll Uses

func (c *Client) ListAll() (list []MessageList, err error)

ListAll returns a MessageList object which contains all messages in the maildrop.

func (*Client) Noop Uses

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

Noop will do nothing however can prolong the end of a connection.

func (*Client) Pass Uses

func (c *Client) Pass(p string) (err error)

Pass sends the password to the server.

func (*Client) Quit Uses

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

Quit sends the quit command to the server and closes the socket.

func (*Client) ReadLine Uses

func (c *Client) ReadLine() (line string, err error)

ReadLine reads a single line from the buffer.

func (*Client) ReadLines Uses

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

ReadLines reads from the buffer until it hits the message end dot (".").

func (*Client) Retr Uses

func (c *Client) Retr(msg int) (m *mail.Message, err error)

Retr downloads the given message and returns it as a mail.Message object.

func (*Client) Rset Uses

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

Rset will unmark any messages that have being marked for deletion in the current session.

func (*Client) Send Uses

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

Send writes a command to the buffer and flushes it. Does not return any lines from the buffer.

func (*Client) Stat Uses

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

Stat retreives a listing for the current maildrop, consisting of the number of messages and the total size of the maildrop.

func (*Client) Top Uses

func (c *Client) Top(msg int, n int) (m *mail.Message, err error)

Top will return a varible number of lines for a given message as a mail.Message object.

func (*Client) Uidl Uses

func (c *Client) Uidl(msg int) (list MessageUidl, err error)

Uidl will return a MessageUidl object which contains the message non unique id and a unique id.

func (*Client) UidlAll Uses

func (c *Client) UidlAll() (list []MessageUidl, err error)

UidlAll will return a MessageUidl object which contains all messages in the maildrop.

func (*Client) User Uses

func (c *Client) User(u string) (err error)

User sends the username to the server.

type MessageList Uses

type MessageList struct {
    // Non unique id reported by the server
    ID  int

    // Size of the message
    Size int
}

MessageList represents the metadata returned by the server for a message stored in the maildrop.

type MessageUidl Uses

type MessageUidl struct {
    // Non unique id reported by the server
    ID  int

    // Unique id reported by the server
    UID string
}

MessageUidl represents the metadata returned by the server for a message stored in the maildrop.

Package pop3 imports 9 packages (graph). Updated 2019-06-09. Refresh now. Tools for package owners.