Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Authorization(user, pass string) (err error)
- func (c *Client) Dele(msg int) (err error)
- func (c *Client) ListAll() (err error)
- func (c *Client) ListCapabilities() (err error)
- func (c *Client) Noop() (err error)
- func (c *Client) Quit() (err error)
- func (c *Client) Retr(msg int) (message *mail.Message, err error)
- func (c *Client) RetrRaw(msg int) (message []byte, err error)
- func (c *Client) Rset() (err error)
- func (c *Client) Stat() (err error)
- func (c *Client) Status() bool
- func (c *Client) Top() (headers []string, err error)
- type Connection
- type MessageList
Constants ¶
This section is empty.
Variables ¶
var Debug bool
Debug mode will add the Client Info and Error information
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // server support for POP3 CAPA command CapaCAPA bool // server support for POP3 TOP command CapaTOP bool // server support for POP3 UIDL command CapaUIDL bool // Count of messages Count int // Size of all messages Size int List []MessageList // List of info messages Info []string // List of errors Errors []error // contains filtered or unexported fields }
Client for POP3 with message list, which represents the metadata returned by the server for a messages stored in the maildrop.
func (*Client) Authorization ¶
Authorization logs into POP3 server with login and password.
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) ListAll ¶
ListAll returns a MessageList object which contains all messages in the maildrop.
func (*Client) ListCapabilities ¶
CAPA List Capabilities.
func (*Client) Rset ¶
Rset will unmark any messages that have being marked for deletion in the current session.
func (*Client) Stat ¶
Stat retrieves a drop listing for the current maildrop, consisting of the number of messages and the total size (in octets) of the maildrop. In the event of an error, all returned numeric values will be 0.
type Connection ¶
type Connection struct { Reader *textproto.Reader Writer *textproto.Writer // contains filtered or unexported fields }
Client holds the net conn and read/write buffer objects.
func NewConnection ¶
func NewConnection(conn io.ReadWriteCloser) *Connection
NewConnection initializes a connection.
func (*Connection) Cmd ¶
func (c *Connection) Cmd(format string, args ...interface{}) (string, error)
Cmd sends the given command on the connection.
func (*Connection) ReadDot ¶
func (c *Connection) ReadDot() (raw []byte, err error)
ReadDot returns the raw mail message.
func (*Connection) ReadLine ¶
func (c *Connection) ReadLine() (string, error)
ReadLine reads a single line from the buffer.
func (*Connection) ReadLines ¶
func (c *Connection) ReadLines() (lines []string, err error)
ReadLines reads from the buffer until it hits the message end dot (".").