imap

package
v0.0.0-...-a24865f Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrResultNo means that NO response is received.
	ErrResultNo = errors.New("result NO")

	// ErrResultBad means that BAD response is received.
	ErrResultBad = errors.New("result BAD")
)
View Source
var (
	// ErrConnDead means that conn is dead.
	ErrConnDead = errors.New("conn dead")
)
View Source
var (
	// ErrNilRep means that nil response is received.
	ErrNilRep = errors.New("nil response")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	UpdateCallback func()
	Debug          io.Writer
	// contains filtered or unexported fields
}

Client is an IMAP client.

func Dial

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

Dial connects to an IMAP server.

func DialTLS

func DialTLS(addr string, tlsConfig *tls.Config) (c *Client, err error)

DialTLS connects to an IMAP server over TLS.

func (*Client) Capability

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

Capability performs CAPIBILITY command.

func (*Client) Close

func (c *Client) Close()

Close closes conn and the client can't be reused.

func (*Client) Done

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

Done performs DONE command.

func (*Client) FetchRFC822

func (c *Client) FetchRFC822(seqs []int, peek bool) (result map[int]*FetchResult, err error)

FetchRFC822 performs FETCH command to fetch RFC822 data.

func (*Client) FetchRFC822Header

func (c *Client) FetchRFC822Header(seqs []int, peek bool) (result map[int]*FetchResult, err error)

FetchRFC822Header performs FETCH command to fetch RFC822.HEADER data.

func (*Client) GetSelectedMailboxInfo

func (c *Client) GetSelectedMailboxInfo() (info MailboxInfo)

GetSelectedMailboxInfo gets current selected mailbox's info.

func (*Client) Idle

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

Idle performs IDLE command.

func (*Client) Login

func (c *Client) Login(user string, pass string) (err error)

Login performs LOGIN command.

func (*Client) Logout

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

Logout performs LOGOUT command.

func (*Client) Noop

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

Noop performs NOOP command.

func (*Client) Search

func (c *Client) Search(criteria string) (seqs []int, err error)

Search performs SEARCH command.

func (*Client) Select

func (c *Client) Select(name string) (info *MailboxInfo, err error)

Select performs SELECT command.

func (*Client) StartTLS

func (c *Client) StartTLS(hostname string) (err error)

StartTLS performs STARTTLS command.

type FetchResult

type FetchResult struct {
	InternalDate string
	Flags        []string
	Data         []byte
}

FetchResult contains the response of FETCH command.

type MailboxInfo

type MailboxInfo struct {
	Name   string
	Exists int
	Recent int
	Flags  []string
}

MailboxInfo contains a mailbox's basic information.

Jump to

Keyboard shortcuts

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