imap

package
v0.0.0-...-9024675 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2015 License: Apache-2.0, BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Name  string
	Email string
}

An Addr represents a single, named email address. If Name is empty, only the email address is known. If Email is empty, the Addr represents an unspecified (but named) group.

func (Addr) String

func (a Addr) String() string

type Box

type Box struct {
	Name   string // name of mailbox
	Elem   string // last element in name
	Client *Client
	// contains filtered or unexported fields
}

A Box represents an IMAP mailbox.

func (*Box) Check

func (b *Box) Check() error

func (*Box) Copy

func (b *Box) Copy(msgs []*Msg) error

func (*Box) Delete

func (b *Box) Delete(msgs []*Msg) error

func (*Box) MarkSeen

func (b *Box) MarkSeen(msgs []*Msg) error

func (*Box) Msgs

func (b *Box) Msgs() []*Msg

func (*Box) Mute

func (b *Box) Mute(msgs []*Msg) error

type Client

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

func NewClient

func NewClient(mode Mode, server, user, passwd string, root string) (*Client, error)

func (*Client) Box

func (c *Client) Box(name string) *Box

func (*Client) Boxes

func (c *Client) Boxes() []*Box

func (*Client) Close

func (c *Client) Close() error

func (*Client) GmailMsgID

func (c *Client) GmailMsgID(id uint64) (*Box, error)

func (*Client) GmailRawSearch

func (c *Client) GmailRawSearch(query string) (*Box, error)

func (*Client) GmailSearch

func (c *Client) GmailSearch(query string) (*Box, error)

func (*Client) GmailThreadID

func (c *Client) GmailThreadID(id uint64) (*Box, error)

func (*Client) Inbox

func (c *Client) Inbox() *Box

func (*Client) IsGmail

func (c *Client) IsGmail() bool

type Flags

type Flags uint32
const (
	FlagJunk Flags = 1 << iota
	FlagNonJunk
	FlagReplied
	FlagFlagged
	FlagDeleted
	FlagDraft
	FlagRecent
	FlagSeen
	FlagNoInferiors
	FlagNoSelect
	FlagMarked
	FlagUnMarked
	FlagHasChildren
	FlagHasNoChildren
	FlagInbox     // Gmail extension
	FlagAllMail   // Gmail extension
	FlagDrafts    // Gmail extension
	FlagSent      // Gmail extension
	FlagSpam      // Gmail extension
	FlagStarred   // Gmail extension
	FlagTrash     // Gmail extension
	FlagImportant // Gmail extension
	FlagMuted     // Gmail extension
)

type Mode

type Mode int

A Mode specifies the IMAP connection mode.

const (
	Unencrypted Mode = iota // unencrypted TCP connection
	StartTLS                // use IMAP STARTTLS command - unimplemented!
	TLS                     // direct TLS connection
	Command                 // exec shell command (server name)
)

type Msg

type Msg struct {
	Box         *Box      // box containing message
	Date        time.Time // date
	Flags       Flags     // message flags
	Bytes       int64     // size in bytes
	Lines       int64     // number of lines
	Hdr         *MsgHdr   // MIME header
	Root        MsgPart   // top-level message part
	GmailID     uint64    // Gmail message id
	GmailThread uint64    // Gmail thread id
	GmailLabels []string
	UID         uint64 // unique id for this message
	// contains filtered or unexported fields
}

A Msg represents an IMAP message.

func (*Msg) Deleted

func (m *Msg) Deleted() bool

type MsgHdr

type MsgHdr struct {
	Date      string
	Subject   string
	From      []Addr
	Sender    []Addr
	ReplyTo   []Addr
	To        []Addr
	CC        []Addr
	BCC       []Addr
	InReplyTo string
	MessageID string
	Digest    string
}

A Hdr represents a message header.

type MsgPart

type MsgPart struct {
	Msg       *Msg // containing message
	Type      string
	ContentID string
	Desc      string
	Encoding  string
	Bytes     int64
	Lines     int64
	Charset   string
	Name      string
	Hdr       *MsgHdr
	ID        string
	Child     []*MsgPart
	// contains filtered or unexported fields
}

A MsgPart represents a single part of a MIME-encoded message.

func (*MsgPart) Raw

func (p *MsgPart) Raw() []byte

func (*MsgPart) ShortText

func (p *MsgPart) ShortText() []byte

func (*MsgPart) Text

func (p *MsgPart) Text() []byte

Jump to

Keyboard shortcuts

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