pop3

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 9 Imported by: 0

README

pop3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Functions

This section is empty.

Types

type Client

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

Client for POP3.

func Dial

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

Dial opens new connection and creates a new POP3 client.

func DialTLS

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

DialTLS opens new TLS connection and creates a new POP3 client.

func NewClient

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

NewClient creates a new POP3 client.

func (*Client) Authorization

func (c *Client) Authorization(user, pass string) error

Authorization logs into POP3 server with login and password.

func (*Client) Dele

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

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

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) Noop

func (c *Client) Noop() error

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

func (*Client) Quit

func (c *Client) Quit() error

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

func (*Client) Rset

func (c *Client) Rset() error

Rset will unmark any messages that have being marked for deletion in the current 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. 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) Close

func (c *Connection) Close() error

Close closes 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) 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 (".").

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.

Jump to

Keyboard shortcuts

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