Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2017 Changes in this version type Client + func (c *Client) InterruptChan(ch <-chan error) v0.1.0 Apr 29, 2015 Changes in this version + const Atom + const Auth + const BAD + const BYE + const Bytes + const Closed + const Continue + const DATETIME + const Data + const Done + const List + const LiteralString + const LogAll + const LogCmd + const LogConn + const LogGo + const LogNone + const LogRaw + const LogState + const Login + const Logout + const NIL + const NO + const Number + const OK + const PREAUTH + const QuotedString + const Selected + const Status + var BufferSize = 65536 + var DefaultLogMask = LogNone + var DefaultLogger = log.New(os.Stderr, "[imap] ", log.Ltime) + var ErrAborted = errors.New("imap: command aborted") + var ErrBadUTF7 = errors.New("imap: bad utf-7 encoding") + var ErrCompressionActive = errors.New("imap: compression already enabled") + var ErrEncryptionActive = errors.New("imap: encryption already enabled") + var ErrExclusive = errors.New("imap: exclusive client access violation") + var ErrNotAllowed = errors.New("imap: command not allowed in the current state") + var ErrTimeout = errors.New("imap: operation timeout") + var SelectFilter = LabelFilter("FLAGS", "EXISTS", "RECENT", "UNSEEN", "PERMANENTFLAGS", "UIDNEXT", ...) + func AsAtom(f Field) string + func AsBytes(f Field) []byte + func AsDateTime(f Field) time.Time + func AsMailbox(f Field) string + func AsNumber(f Field) uint32 + func AsString(f Field) string + func ByeFilter(_ *Command, rsp *Response) bool + func FetchFilter(cmd *Command, rsp *Response) bool + func NameFilter(cmd *Command, rsp *Response) bool + func Quote(s string, utf8quoted bool) string + func QuoteBytes(s []byte, utf8quoted bool) []byte + func Quoted(f Field) bool + func QuotedUTF8(f Field) bool + func UTF7Decode(u string) (s string, err error) + func UTF7DecodeBytes(u []byte) (s []byte, err error) + func UTF7Encode(s string) string + func UTF7EncodeBytes(s []byte) []byte + func Unquote(q string) (s string, ok bool) + func UnquoteBytes(q []byte) (s []byte, ok bool) + type Client struct + Caps map[string]bool + CommandConfig map[string]*CommandConfig + Data []*Response + Mailbox *MailboxStatus + func Dial(addr string) (c *Client, err error) + func DialTLS(addr string, config *tls.Config) (c *Client, err error) + func NewClient(conn net.Conn, host string, timeout time.Duration) (c *Client, err error) + func (c *Client) Append(mbox string, flags FlagSet, idate *time.Time, msg Literal) (cmd *Command, err error) + func (c *Client) Auth(a SASL) (cmd *Command, err error) + func (c *Client) Capability() (cmd *Command, err error) + func (c *Client) Check() (cmd *Command, err error) + func (c *Client) Close(expunge bool) (cmd *Command, err error) + func (c *Client) CompressDeflate(level int) (cmd *Command, err error) + func (c *Client) Copy(seq *SeqSet, mbox string) (cmd *Command, err error) + func (c *Client) Create(mbox string) (cmd *Command, err error) + func (c *Client) Delete(mbox string) (cmd *Command, err error) + func (c *Client) Enable(caps ...string) (cmd *Command, err error) + func (c *Client) Expunge(uids *SeqSet) (cmd *Command, err error) + func (c *Client) Fetch(seq *SeqSet, items ...string) (cmd *Command, err error) + func (c *Client) GetQuota(root string, quota ...*Quota) (cmd *Command, err error) + func (c *Client) GetQuotaRoot(mbox string) (cmd *Command, err error) + func (c *Client) ID(info ...string) (cmd *Command, err error) + func (c *Client) Idle() (cmd *Command, err error) + func (c *Client) IdleTerm() (cmd *Command, err error) + func (c *Client) LSub(ref, mbox string) (cmd *Command, err error) + func (c *Client) List(ref, mbox string) (cmd *Command, err error) + func (c *Client) Login(username, password string) (cmd *Command, err error) + func (c *Client) Logout(timeout time.Duration) (cmd *Command, err error) + func (c *Client) Noop() (cmd *Command, err error) + func (c *Client) Quote(v interface{}) Field + func (c *Client) Recv(timeout time.Duration) error + func (c *Client) Rename(old, new string) (cmd *Command, err error) + func (c *Client) Search(spec ...Field) (cmd *Command, err error) + func (c *Client) Select(mbox string, readonly bool) (cmd *Command, err error) + func (c *Client) Send(name string, fields ...Field) (cmd *Command, err error) + func (c *Client) SetLiteralReader(lr LiteralReader) LiteralReader + func (c *Client) SetQuota(root string, quota ...*Quota) (cmd *Command, err error) + func (c *Client) StartTLS(config *tls.Config) (cmd *Command, err error) + func (c *Client) State() ConnState + func (c *Client) Status(mbox string, items ...string) (cmd *Command, err error) + func (c *Client) Store(seq *SeqSet, item string, value Field) (cmd *Command, err error) + func (c *Client) Subscribe(mbox string) (cmd *Command, err error) + func (c *Client) UIDCopy(seq *SeqSet, mbox string) (cmd *Command, err error) + func (c *Client) UIDFetch(seq *SeqSet, items ...string) (cmd *Command, err error) + func (c *Client) UIDSearch(spec ...Field) (cmd *Command, err error) + func (c *Client) UIDStore(seq *SeqSet, item string, value Field) (cmd *Command, err error) + func (c *Client) Unsubscribe(mbox string) (cmd *Command, err error) + func (d Client) Log(mask LogMask, v ...interface{}) + func (d Client) Logf(mask LogMask, format string, v ...interface{}) + func (d Client) Logln(mask LogMask, v ...interface{}) + func (d Client) SetLogMask(mask LogMask) LogMask + func (d Client) SetLogger(log *log.Logger) *log.Logger + type Command struct + Data []*Response + func Wait(cmd *Command, err error) (*Command, error) + func (cmd *Command) Client() *Client + func (cmd *Command) InProgress() bool + func (cmd *Command) Name(full bool) string + func (cmd *Command) Result(expect RespStatus) (rsp *Response, err error) + func (cmd *Command) String() string + func (cmd *Command) Tag() string + func (cmd *Command) UID() bool + type CommandConfig struct + Exclusive bool + Filter ResponseFilter + States ConnState + type ConnState uint8 + func (v ConnState) GoString() string + func (v ConnState) String() string + type Field interface + func AsList(f Field) []Field + type FieldMap map[string]Field + func AsFieldMap(f Field) FieldMap + func (fm FieldMap) String() string + type FieldType uint8 + func TypeOf(f Field) FieldType + func (v FieldType) GoString() string + func (v FieldType) String() string + type FlagSet map[string]bool + func AsFlagSet(f Field) FlagSet + func NewFlagSet(flags ...string) FlagSet + func (fs FlagSet) Replace(f Field) + func (fs FlagSet) String() string + type Literal interface + Info func() LiteralInfo + func NewLiteral(b []byte) Literal + func NewLiteral8(b []byte) Literal + type LiteralInfo struct + Bin bool + Len uint32 + type LiteralReader interface + ReadLiteral func(r io.Reader, i LiteralInfo) (Literal, error) + type LogMask uint8 + func (v LogMask) GoString() string + func (v LogMask) String() string + type MailboxInfo struct + Attrs FlagSet + Delim string + Name string + type MailboxStatus struct + Flags FlagSet + Messages uint32 + Name string + PermFlags FlagSet + ReadOnly bool + Recent uint32 + UIDNext uint32 + UIDNotSticky bool + UIDValidity uint32 + Unseen uint32 + func (m *MailboxStatus) String() string + type MemoryReader struct + func (MemoryReader) ReadLiteral(r io.Reader, i LiteralInfo) (Literal, error) + type MessageInfo struct + Attrs FieldMap + Flags FlagSet + InternalDate time.Time + Seq uint32 + Size uint32 + UID uint32 + type MockServer interface + Close func(flush bool) error + Closed func() bool + Compressed func() bool + EnableDeflate func(level int) error + EnableTLS func(config *tls.Config) error + Encrypted func() bool + Flush func() error + Read func(p []byte) (n int, err error) + ReadLine func() (line []byte, err error) + Write func(p []byte) (n int, err error) + WriteLine func(line []byte) error + func NewMockServer(conn net.Conn) MockServer + type NotAvailableError string + func (err NotAvailableError) Error() string + type ParserError struct + Info string + Line []byte + Offset int + func (err *ParserError) Error() string + type ProtocolError struct + Info string + Line []byte + func (err *ProtocolError) Error() string + type Quota struct + Limit uint32 + Resource string + Usage uint32 + type RespStatus uint8 + func (v RespStatus) GoString() string + func (v RespStatus) String() string + type RespType uint8 + func (v RespType) GoString() string + func (v RespType) String() string + type Response struct + Decoded interface{} + Fields []Field + Info string + Label string + Literals []Literal + Order int64 + Raw []byte + Status RespStatus + Tag string + Type RespType + func (rsp *Response) Challenge() []byte + func (rsp *Response) MailboxFlags() FlagSet + func (rsp *Response) MailboxInfo() *MailboxInfo + func (rsp *Response) MailboxStatus() *MailboxStatus + func (rsp *Response) MessageInfo() *MessageInfo + func (rsp *Response) Quota() (root string, quota []*Quota) + func (rsp *Response) QuotaRoot() (mbox string, roots []string) + func (rsp *Response) SearchResults() []uint32 + func (rsp *Response) String() string + func (rsp *Response) Value() uint32 + type ResponseError struct + Reason string + func (rsp ResponseError) Error() string + type ResponseFilter func(cmd *Command, rsp *Response) bool + func LabelFilter(labels ...string) ResponseFilter + type SASL interface + Next func(challenge []byte) (response []byte, err error) + Start func(s *ServerInfo) (mech string, ir []byte, err error) + func ExternalAuth(identity string) SASL + func PlainAuth(username, password, identity string) SASL + type SeqSet struct + func NewSeqSet(set string) (s *SeqSet, err error) + func (s *SeqSet) Add(set string) error + func (s *SeqSet) AddNum(q ...uint32) + func (s *SeqSet) AddRange(start, stop uint32) + func (s *SeqSet) AddSet(t *SeqSet) + func (s *SeqSet) Clear() + func (s SeqSet) Contains(q uint32) bool + func (s SeqSet) Dynamic() bool + func (s SeqSet) Empty() bool + func (s SeqSet) String() string + type SeqSetError string + func (err SeqSetError) Error() string + type ServerInfo struct + Auth []string + Name string + TLS bool