Versions in this module Expand all Collapse all v0 v0.1.2 Oct 1, 2026 v0.1.1 Oct 1, 2026 Changes in this version + const BotUsage + const Inbox + const Sent + var ErrNotFound = errors.New("mailbox: message not found") + var ErrNotMember = errors.New(...) + func FormatAddress(a Address) string + func RunBot(ctx context.Context, c *Client, args []string, in io.Reader, out io.Writer) error + func RunReader(s ssh.Session, c *Client) error + func Snippet(body string, max int) string + func ValidEmail(v string) bool + func VerifyLogin(addr, user, pass string, plaintext bool) error + type Address struct + Address string + Name string + func ParseAddress(raw string) Address + type Attachment struct + ContentType string + Filename string + Size int + type Client struct + func NewClient(t Transport, id Identity, domain string, pageSize int) *Client + func (c *Client) Address() string + func (c *Client) Close() error + func (c *Client) Delete(ctx context.Context, mailbox string, uid uint32) error + func (c *Client) Flag(ctx context.Context, mailbox string, uid uint32, flagged bool) error + func (c *Client) List(ctx context.Context, mailbox string, limit int) ([]MessageSummary, error) + func (c *Client) Mailboxes(ctx context.Context) ([]Mailbox, error) + func (c *Client) MarkSeen(ctx context.Context, mailbox string, uid uint32, seen bool) error + func (c *Client) Read(ctx context.Context, mailbox string, uid uint32, peek bool) (Message, bool, error) + func (c *Client) Reply(ctx context.Context, orig Message, text string, replyAll bool) (SendResult, error) + func (c *Client) Search(ctx context.Context, query, mailbox string, limit int) ([]MessageSummary, error) + func (c *Client) Send(ctx context.Context, d Draft) (SendResult, error) + type Draft struct + BCC []Address + CC []Address + InReplyTo string + Subject string + Text string + To []Address + func NormalizeDraft(d Draft) (Draft, error) + type FlagChange struct + Flagged *bool + Seen *bool + type IMAPConfig struct + IMAPAddr string + Password string + Plaintext bool + SMTPAddr string + SMTPPass string + SMTPServerName string + SMTPUser string + Username string + type Identity struct + Name string + Paid bool + type ListOptions struct + Limit int + Mailbox string + type Mailbox struct + Name string + Path string + Total int + Unseen int + type MemoryTransport struct + func NewMemoryTransport() *MemoryTransport + func (m *MemoryTransport) Add(msg Message) Message + func (m *MemoryTransport) Close() error + func (m *MemoryTransport) DeleteMessage(_ context.Context, mailbox string, uid uint32) error + func (m *MemoryTransport) ListMailboxes(_ context.Context) ([]Mailbox, error) + func (m *MemoryTransport) ListMessages(_ context.Context, opts ListOptions) ([]MessageSummary, error) + func (m *MemoryTransport) ReadMessage(_ context.Context, mailbox string, uid uint32) (Message, bool, error) + func (m *MemoryTransport) Search(_ context.Context, opts SearchOptions) ([]MessageSummary, error) + func (m *MemoryTransport) Send(_ context.Context, from string, d Draft) (SendResult, error) + func (m *MemoryTransport) SetFlags(_ context.Context, mailbox string, uid uint32, fc FlagChange) error + type Message struct + Attachments []Attachment + CC []Address + HTML string + MessageID string + References []string + ReplyTo *Address + Text string + type MessageSummary struct + Date time.Time + Flagged bool + From Address + HasAttachments bool + Mailbox string + Seen bool + Snippet string + Subject string + To []Address + UID uint32 + type SearchOptions struct + Limit int + Mailbox string + Query string + type SendResult struct + MessageID string + type Transport interface + Close func() error + DeleteMessage func(ctx context.Context, mailbox string, uid uint32) error + ListMailboxes func(ctx context.Context) ([]Mailbox, error) + ListMessages func(ctx context.Context, opts ListOptions) ([]MessageSummary, error) + ReadMessage func(ctx context.Context, mailbox string, uid uint32) (Message, bool, error) + Search func(ctx context.Context, opts SearchOptions) ([]MessageSummary, error) + Send func(ctx context.Context, from string, d Draft) (SendResult, error) + SetFlags func(ctx context.Context, mailbox string, uid uint32, fc FlagChange) error + func NewIMAPTransport(cfg IMAPConfig) (Transport, error)