Documentation
¶
Overview ¶
Package imap provides IMAP client functionality for nmail.
Index ¶
- Variables
- type Client
- func (cl *Client) Close() error
- func (cl *Client) FetchInbox(limit int) ([]Message, error)
- func (cl *Client) FetchMessage(id uint32) (*Message, error)
- func (cl *Client) SearchMessages(query SearchQuery) ([]Message, error)
- func (cl *Client) Watch(ctx context.Context, fallbackPollInterval time.Duration, ...) error
- func (cl *Client) WatchIDLE(ctx context.Context, onNew func(Message) error) error
- func (cl *Client) WatchPoll(ctx context.Context, interval time.Duration, onNew func(Message) error) error
- type Message
- type SearchQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIdleUnsupported = errors.New("imap idle unsupported")
ErrIdleUnsupported indicates the IMAP server rejected the IDLE command.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an IMAP connection.
func (*Client) FetchInbox ¶
FetchInbox returns the latest `limit` messages from INBOX (headers only).
func (*Client) FetchMessage ¶
FetchMessage returns the full message including body.
func (*Client) SearchMessages ¶
func (cl *Client) SearchMessages(query SearchQuery) ([]Message, error)
SearchMessages returns messages in INBOX matching the provided filters.
func (*Client) Watch ¶
func (cl *Client) Watch(ctx context.Context, fallbackPollInterval time.Duration, onNew func(Message) error) error
Watch watches INBOX for new messages, preferring IMAP IDLE and falling back to polling when IDLE isn't supported.
Click to show internal directories.
Click to hide internal directories.