Documentation ¶
Overview ¶
Package pop3 provides an implementation of the Post Office Protocol - Version 3.
Index ¶
- Constants
- func IsErr(s string) bool
- func IsOK(s string) bool
- type Client
- func (c *Client) Auth(u, p string) (err error)
- func (c *Client) Cmd(format string, args ...interface{}) (line string, err error)
- func (c *Client) Dele(msg int) (err error)
- func (c *Client) List(msg int) (list MessageList, err error)
- func (c *Client) ListAll() (list []MessageList, err error)
- func (c *Client) Noop() (err error)
- func (c *Client) Pass(p string) (err error)
- func (c *Client) Quit() (err error)
- func (c *Client) ReadLine() (line string, err error)
- func (c *Client) ReadLines() (lines []string, err error)
- func (c *Client) Retr(msg int) (m *mail.Message, err error)
- func (c *Client) Rset() (err error)
- func (c *Client) Send(format string, args ...interface{}) (err error)
- func (c *Client) Stat() (count, size int, err error)
- func (c *Client) Top(msg int, n int) (m *mail.Message, err error)
- func (c *Client) Uidl(msg int) (list MessageUidl, err error)
- func (c *Client) UidlAll() (list []MessageUidl, err error)
- func (c *Client) User(u string) (err error)
- type MessageList
- type MessageUidl
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.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the net conn and read/write buffer objects.
func (*Client) Auth ¶
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) Dele ¶
Dele will delete the given message from the maildrop. Changes will only take affect after the Quit command is issued.
func (*Client) List ¶
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 ¶
func (c *Client) ListAll() (list []MessageList, err error)
ListAll returns a MessageList object which contains all messages in the maildrop.
func (*Client) Rset ¶
Rset will unmark any messages that have being marked for deletion in the current session.
func (*Client) Send ¶
Send writes a command to the buffer and flushes it. Does not return any lines from the buffer.
func (*Client) Stat ¶
Stat retreives a listing for the current maildrop, consisting of the number of messages and the total size of the maildrop.
func (*Client) Top ¶
Top will return a varible number of lines for a given message as a mail.Message object.
func (*Client) Uidl ¶
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 ¶
func (c *Client) UidlAll() (list []MessageUidl, err error)
UidlAll will return a MessageUidl object which contains all messages in the maildrop.
type MessageList ¶
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 ¶
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.